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

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

Issue 915533002: Steps towards making dart2js JS AST templates an indepentent library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
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 part of js; 5 part of js;
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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 final String code; 515 final String code;
516 516
517 LiteralStatement(this.code); 517 LiteralStatement(this.code);
518 518
519 accept(NodeVisitor visitor) => visitor.visitLiteralStatement(this); 519 accept(NodeVisitor visitor) => visitor.visitLiteralStatement(this);
520 void visitChildren(NodeVisitor visitor) { } 520 void visitChildren(NodeVisitor visitor) { }
521 521
522 LiteralStatement _clone() => new LiteralStatement(code); 522 LiteralStatement _clone() => new LiteralStatement(code);
523 } 523 }
524 524
525 // Not a real javascript node, but represents the yield statement from a dart 525 // Not a real JavaScript node, but represents the yield statement from a dart
526 // program translated to javascript. 526 // program translated to JavaScript.
527 class DartYield extends Statement { 527 class DartYield extends Statement {
528 final Expression expression; 528 final Expression expression;
529 529
530 final bool hasStar; 530 final bool hasStar;
531 531
532 DartYield(this.expression, this.hasStar); 532 DartYield(this.expression, this.hasStar);
533 533
534 accept(NodeVisitor visitor) => visitor.visitDartYield(this); 534 accept(NodeVisitor visitor) => visitor.visitDartYield(this);
535 535
536 void visitChildren(NodeVisitor visitor) { 536 void visitChildren(NodeVisitor visitor) {
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 accept(NodeVisitor visitor) => visitor.visitRegExpLiteral(this); 1120 accept(NodeVisitor visitor) => visitor.visitRegExpLiteral(this);
1121 void visitChildren(NodeVisitor visitor) {} 1121 void visitChildren(NodeVisitor visitor) {}
1122 RegExpLiteral _clone() => new RegExpLiteral(pattern); 1122 RegExpLiteral _clone() => new RegExpLiteral(pattern);
1123 1123
1124 int get precedenceLevel => PRIMARY; 1124 int get precedenceLevel => PRIMARY;
1125 } 1125 }
1126 1126
1127 /** 1127 /**
1128 * An asynchronous await. 1128 * An asynchronous await.
1129 * 1129 *
1130 * Not part of javascript. We desugar this expression before outputting. 1130 * Not part of JavaScript. We desugar this expression before outputting.
1131 * Should only occur in a [Fun] with `asyncModifier` async or asyncStar. 1131 * Should only occur in a [Fun] with `asyncModifier` async or asyncStar.
1132 */ 1132 */
1133 class Await extends Expression { 1133 class Await extends Expression {
1134 /** The awaited expression. */ 1134 /** The awaited expression. */
1135 final Expression expression; 1135 final Expression expression;
1136 1136
1137 Await(this.expression); 1137 Await(this.expression);
1138 1138
1139 int get precedenceLevel => UNARY; 1139 int get precedenceLevel => UNARY;
1140 accept(NodeVisitor visitor) => visitor.visitAwait(this); 1140 accept(NodeVisitor visitor) => visitor.visitAwait(this);
(...skipping 11 matching lines...) Expand all
1152 class Comment extends Statement { 1152 class Comment extends Statement {
1153 final String comment; 1153 final String comment;
1154 1154
1155 Comment(this.comment); 1155 Comment(this.comment);
1156 1156
1157 accept(NodeVisitor visitor) => visitor.visitComment(this); 1157 accept(NodeVisitor visitor) => visitor.visitComment(this);
1158 Comment _clone() => new Comment(comment); 1158 Comment _clone() => new Comment(comment);
1159 1159
1160 void visitChildren(NodeVisitor visitor) {} 1160 void visitChildren(NodeVisitor visitor) {}
1161 } 1161 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698