| OLD | NEW |
| 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 interface NodeVisitor<T> { | 5 interface NodeVisitor<T> { |
| 6 T visitProgram(Program node); | 6 T visitProgram(Program node); |
| 7 | 7 |
| 8 T visitBlock(Block node); | 8 T visitBlock(Block node); |
| 9 T visitExpressionStatement(ExpressionStatement node); | 9 T visitExpressionStatement(ExpressionStatement node); |
| 10 T visitEmptyStatement(EmptyStatement node); | 10 T visitEmptyStatement(EmptyStatement node); |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 435 |
| 436 LiteralExpression(this.template) : inputs = const []; | 436 LiteralExpression(this.template) : inputs = const []; |
| 437 LiteralExpression.withData(this.template, this.inputs); | 437 LiteralExpression.withData(this.template, this.inputs); |
| 438 | 438 |
| 439 accept(NodeVisitor visitor) => visitor.visitLiteralExpression(this); | 439 accept(NodeVisitor visitor) => visitor.visitLiteralExpression(this); |
| 440 | 440 |
| 441 void visitChildren(NodeVisitor visitor) { | 441 void visitChildren(NodeVisitor visitor) { |
| 442 for (Expression expr in inputs) expr.accept(visitor); | 442 for (Expression expr in inputs) expr.accept(visitor); |
| 443 } | 443 } |
| 444 | 444 |
| 445 int get precedenceLevel() => EXPRESSION; | 445 // Code that uses JS must take care of operator precedences, and |
| 446 // put parenthesis if needed. |
| 447 int get precedenceLevel() => PRIMARY; |
| 446 } | 448 } |
| 447 | 449 |
| 448 /** | 450 /** |
| 449 * [VariableDeclarationList] is a subclass of [Expression] to simplify the | 451 * [VariableDeclarationList] is a subclass of [Expression] to simplify the |
| 450 * AST. | 452 * AST. |
| 451 */ | 453 */ |
| 452 class VariableDeclarationList extends Expression { | 454 class VariableDeclarationList extends Expression { |
| 453 final List<VariableInitialization> declarations; | 455 final List<VariableInitialization> declarations; |
| 454 | 456 |
| 455 VariableDeclarationList(this.declarations); | 457 VariableDeclarationList(this.declarations); |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 /** Contains the pattern and the flags.*/ | 830 /** Contains the pattern and the flags.*/ |
| 829 String pattern; | 831 String pattern; |
| 830 | 832 |
| 831 RegExpLiteral(this.pattern); | 833 RegExpLiteral(this.pattern); |
| 832 | 834 |
| 833 accept(NodeVisitor visitor) => visitor.visitRegExpLiteral(this); | 835 accept(NodeVisitor visitor) => visitor.visitRegExpLiteral(this); |
| 834 void visitChildren(NodeVisitor visitor) {} | 836 void visitChildren(NodeVisitor visitor) {} |
| 835 | 837 |
| 836 int get precedenceLevel() => PRIMARY; | 838 int get precedenceLevel() => PRIMARY; |
| 837 } | 839 } |
| OLD | NEW |