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 part of js_ast; | 5 part of js_ast; |
6 | 6 |
7 abstract class NodeVisitor<T> { | 7 abstract class NodeVisitor<T> { |
8 T visitProgram(Program node); | 8 T visitProgram(Program node); |
9 | 9 |
10 T visitBlock(Block node); | 10 T visitBlock(Block node); |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 | 590 |
591 bool get allowRename => false; | 591 bool get allowRename => false; |
592 } | 592 } |
593 | 593 |
594 class LiteralStringFromName extends LiteralString { | 594 class LiteralStringFromName extends LiteralString { |
595 Name name; | 595 Name name; |
596 | 596 |
597 LiteralStringFromName(this.name) : super(null); | 597 LiteralStringFromName(this.name) : super(null); |
598 | 598 |
599 String get value => '"${name.name}"'; | 599 String get value => '"${name.name}"'; |
| 600 |
| 601 void visitChildren(NodeVisitor visitor) { |
| 602 name.accept(visitor); |
| 603 } |
600 } | 604 } |
601 | 605 |
602 class LiteralExpression extends Expression { | 606 class LiteralExpression extends Expression { |
603 final String template; | 607 final String template; |
604 final List<Expression> inputs; | 608 final List<Expression> inputs; |
605 | 609 |
606 LiteralExpression(this.template) : inputs = const []; | 610 LiteralExpression(this.template) : inputs = const []; |
607 LiteralExpression.withData(this.template, this.inputs); | 611 LiteralExpression.withData(this.template, this.inputs); |
608 | 612 |
609 accept(NodeVisitor visitor) => visitor.visitLiteralExpression(this); | 613 accept(NodeVisitor visitor) => visitor.visitLiteralExpression(this); |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 class Comment extends Statement { | 1277 class Comment extends Statement { |
1274 final String comment; | 1278 final String comment; |
1275 | 1279 |
1276 Comment(this.comment); | 1280 Comment(this.comment); |
1277 | 1281 |
1278 accept(NodeVisitor visitor) => visitor.visitComment(this); | 1282 accept(NodeVisitor visitor) => visitor.visitComment(this); |
1279 Comment _clone() => new Comment(comment); | 1283 Comment _clone() => new Comment(comment); |
1280 | 1284 |
1281 void visitChildren(NodeVisitor visitor) {} | 1285 void visitChildren(NodeVisitor visitor) {} |
1282 } | 1286 } |
OLD | NEW |