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

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

Issue 1328303002: fix implicit_scope_test and builtin_identifier_test (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: format Created 5 years, 3 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
« no previous file with comments | « lib/src/codegen/js_names.dart ('k') | lib/src/js/printer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 Program _clone() => new Program(body); 271 Program _clone() => new Program(body);
272 } 272 }
273 273
274 abstract class Statement extends Node { 274 abstract class Statement extends Node {
275 Statement toStatement() => this; 275 Statement toStatement() => this;
276 Statement toReturn() => new Block([this, new Return()]); 276 Statement toReturn() => new Block([this, new Return()]);
277 } 277 }
278 278
279 class Block extends Statement { 279 class Block extends Statement {
280 final List<Statement> statements; 280 final List<Statement> statements;
281 Block(this.statements) { 281
282 /// True to preserve this [Block] for scoping reasons.
283 final bool isScope;
284
285 Block(this.statements, {this.isScope: false}) {
282 assert(!statements.any((s) => s is! Statement)); 286 assert(!statements.any((s) => s is! Statement));
283 } 287 }
284 Block.empty() : this.statements = <Statement>[]; 288 Block.empty() : this.statements = <Statement>[];
285 289
286 accept(NodeVisitor visitor) => visitor.visitBlock(this); 290 accept(NodeVisitor visitor) => visitor.visitBlock(this);
287 void visitChildren(NodeVisitor visitor) { 291 void visitChildren(NodeVisitor visitor) {
288 for (Statement statement in statements) statement.accept(visitor); 292 for (Statement statement in statements) statement.accept(visitor);
289 } 293 }
290 Block _clone() => new Block(statements); 294 Block _clone() => new Block(statements);
291 } 295 }
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 final Expression expression; 1567 final Expression expression;
1564 1568
1565 CommentExpression(this.comment, this.expression); 1569 CommentExpression(this.comment, this.expression);
1566 1570
1567 int get precedenceLevel => PRIMARY; 1571 int get precedenceLevel => PRIMARY;
1568 accept(NodeVisitor visitor) => visitor.visitCommentExpression(this); 1572 accept(NodeVisitor visitor) => visitor.visitCommentExpression(this);
1569 CommentExpression _clone() => new CommentExpression(comment, expression); 1573 CommentExpression _clone() => new CommentExpression(comment, expression);
1570 1574
1571 void visitChildren(NodeVisitor visitor) => expression.accept(visitor); 1575 void visitChildren(NodeVisitor visitor) => expression.accept(visitor);
1572 } 1576 }
OLDNEW
« no previous file with comments | « lib/src/codegen/js_names.dart ('k') | lib/src/js/printer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698