Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(822)

Side by Side Diff: pkg/compiler/lib/src/tree/nodes.dart

Issue 2832403002: merge PrecedenceInfo into TokenType and update all refs (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:collection' show IterableMixin; 5 import 'dart:collection' show IterableMixin;
6 6
7 import '../common.dart'; 7 import 'package:front_end/src/fasta/fasta_codes.dart' show FastaMessage;
8 import '../elements/elements.dart' show MetadataAnnotation;
9 import 'package:front_end/src/fasta/scanner/precedence.dart' as Precedence
10 show FUNCTION_INFO;
11 import 'package:front_end/src/fasta/scanner.dart' show BeginGroupToken, Token; 8 import 'package:front_end/src/fasta/scanner.dart' show BeginGroupToken, Token;
12 import 'package:front_end/src/fasta/scanner/token_constants.dart' as Tokens 9 import 'package:front_end/src/fasta/scanner/token_constants.dart' as Tokens
13 show PLUS_TOKEN; 10 show PLUS_TOKEN;
14 import 'package:front_end/src/fasta/scanner/characters.dart'; 11 import 'package:front_end/src/fasta/scanner/characters.dart';
12 import 'package:front_end/src/scanner/token.dart' show TokenType;
13
14 import '../common.dart';
15 import '../elements/elements.dart' show MetadataAnnotation;
15 import '../util/util.dart'; 16 import '../util/util.dart';
16 import 'dartstring.dart'; 17 import 'dartstring.dart';
17 import 'prettyprint.dart'; 18 import 'prettyprint.dart';
18 import 'unparser.dart'; 19 import 'unparser.dart';
19 import 'package:front_end/src/fasta/fasta_codes.dart' show FastaMessage;
20 20
21 abstract class Visitor<R> { 21 abstract class Visitor<R> {
22 const Visitor(); 22 const Visitor();
23 23
24 R visitNode(Node node); 24 R visitNode(Node node);
25 25
26 R visitAssert(Assert node) => visitStatement(node); 26 R visitAssert(Assert node) => visitStatement(node);
27 R visitAsyncForIn(AsyncForIn node) => visitForIn(node); 27 R visitAsyncForIn(AsyncForIn node) => visitForIn(node);
28 R visitAsyncModifier(AsyncModifier node) => visitNode(node); 28 R visitAsyncModifier(AsyncModifier node) => visitNode(node);
29 R visitAwait(Await node) => visitExpression(node); 29 R visitAwait(Await node) => visitExpression(node);
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 final Token beginToken; 1520 final Token beginToken;
1521 final Token endToken; 1521 final Token endToken;
1522 1522
1523 Return(this.beginToken, this.endToken, this.expression); 1523 Return(this.beginToken, this.endToken, this.expression);
1524 1524
1525 Return asReturn() => this; 1525 Return asReturn() => this;
1526 1526
1527 bool get hasExpression => expression != null; 1527 bool get hasExpression => expression != null;
1528 1528
1529 /// `true` if this return is of the form `=> e;`. 1529 /// `true` if this return is of the form `=> e;`.
1530 bool get isArrowBody => beginToken.info == Precedence.FUNCTION_INFO; 1530 bool get isArrowBody => beginToken.info == TokenType.FUNCTION;
1531 1531
1532 accept(Visitor visitor) => visitor.visitReturn(this); 1532 accept(Visitor visitor) => visitor.visitReturn(this);
1533 1533
1534 accept1(Visitor1 visitor, arg) => visitor.visitReturn(this, arg); 1534 accept1(Visitor1 visitor, arg) => visitor.visitReturn(this, arg);
1535 1535
1536 visitChildren(Visitor visitor) { 1536 visitChildren(Visitor visitor) {
1537 if (expression != null) expression.accept(visitor); 1537 if (expression != null) expression.accept(visitor);
1538 } 1538 }
1539 1539
1540 visitChildren1(Visitor1 visitor, arg) { 1540 visitChildren1(Visitor1 visitor, arg) {
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after
3278 */ 3278 */
3279 Object getTreeElement(TreeElementMixin node) => node._element; 3279 Object getTreeElement(TreeElementMixin node) => node._element;
3280 3280
3281 /** 3281 /**
3282 * Do not call this method directly. Instead, use an instance of 3282 * Do not call this method directly. Instead, use an instance of
3283 * TreeElements. 3283 * TreeElements.
3284 */ 3284 */
3285 void setTreeElement(TreeElementMixin node, Object value) { 3285 void setTreeElement(TreeElementMixin node, Object value) {
3286 node._element = value; 3286 node._element = value;
3287 } 3287 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/enum_creator.dart ('k') | pkg/front_end/lib/src/fasta/parser/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698