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

Side by Side Diff: lib/visitor.dart

Issue 2460373002: Remove BlockExpression from the Kernel language. (Closed)
Patch Set: Incorporate review comments, format continuation.dart. Created 4 years, 1 month 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/type_propagation/builder.dart ('k') | no next file » | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library kernel.ast.visitor; 4 library kernel.ast.visitor;
5 5
6 import 'ast.dart'; 6 import 'ast.dart';
7 7
8 abstract class ExpressionVisitor<R> { 8 abstract class ExpressionVisitor<R> {
9 R defaultExpression(Expression node) => null; 9 R defaultExpression(Expression node) => null;
10 R defaultBasicLiteral(BasicLiteral node) => defaultExpression(node); 10 R defaultBasicLiteral(BasicLiteral node) => defaultExpression(node);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 R visitListLiteral(ListLiteral node) => defaultExpression(node); 44 R visitListLiteral(ListLiteral node) => defaultExpression(node);
45 R visitMapLiteral(MapLiteral node) => defaultExpression(node); 45 R visitMapLiteral(MapLiteral node) => defaultExpression(node);
46 R visitAwaitExpression(AwaitExpression node) => defaultExpression(node); 46 R visitAwaitExpression(AwaitExpression node) => defaultExpression(node);
47 R visitFunctionExpression(FunctionExpression node) => defaultExpression(node); 47 R visitFunctionExpression(FunctionExpression node) => defaultExpression(node);
48 R visitStringLiteral(StringLiteral node) => defaultBasicLiteral(node); 48 R visitStringLiteral(StringLiteral node) => defaultBasicLiteral(node);
49 R visitIntLiteral(IntLiteral node) => defaultBasicLiteral(node); 49 R visitIntLiteral(IntLiteral node) => defaultBasicLiteral(node);
50 R visitDoubleLiteral(DoubleLiteral node) => defaultBasicLiteral(node); 50 R visitDoubleLiteral(DoubleLiteral node) => defaultBasicLiteral(node);
51 R visitBoolLiteral(BoolLiteral node) => defaultBasicLiteral(node); 51 R visitBoolLiteral(BoolLiteral node) => defaultBasicLiteral(node);
52 R visitNullLiteral(NullLiteral node) => defaultBasicLiteral(node); 52 R visitNullLiteral(NullLiteral node) => defaultBasicLiteral(node);
53 R visitLet(Let node) => defaultExpression(node); 53 R visitLet(Let node) => defaultExpression(node);
54 R visitBlockExpression(BlockExpression node) => defaultExpression(node);
55 } 54 }
56 55
57 abstract class StatementVisitor<R> { 56 abstract class StatementVisitor<R> {
58 R defaultStatement(Statement node) => null; 57 R defaultStatement(Statement node) => null;
59 58
60 R visitInvalidStatement(InvalidStatement node) => defaultStatement(node); 59 R visitInvalidStatement(InvalidStatement node) => defaultStatement(node);
61 R visitExpressionStatement(ExpressionStatement node) => 60 R visitExpressionStatement(ExpressionStatement node) =>
62 defaultStatement(node); 61 defaultStatement(node);
63 R visitBlock(Block node) => defaultStatement(node); 62 R visitBlock(Block node) => defaultStatement(node);
64 R visitEmptyStatement(EmptyStatement node) => defaultStatement(node); 63 R visitEmptyStatement(EmptyStatement node) => defaultStatement(node);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 R visitListLiteral(ListLiteral node) => defaultExpression(node); 148 R visitListLiteral(ListLiteral node) => defaultExpression(node);
150 R visitMapLiteral(MapLiteral node) => defaultExpression(node); 149 R visitMapLiteral(MapLiteral node) => defaultExpression(node);
151 R visitAwaitExpression(AwaitExpression node) => defaultExpression(node); 150 R visitAwaitExpression(AwaitExpression node) => defaultExpression(node);
152 R visitFunctionExpression(FunctionExpression node) => defaultExpression(node); 151 R visitFunctionExpression(FunctionExpression node) => defaultExpression(node);
153 R visitStringLiteral(StringLiteral node) => defaultBasicLiteral(node); 152 R visitStringLiteral(StringLiteral node) => defaultBasicLiteral(node);
154 R visitIntLiteral(IntLiteral node) => defaultBasicLiteral(node); 153 R visitIntLiteral(IntLiteral node) => defaultBasicLiteral(node);
155 R visitDoubleLiteral(DoubleLiteral node) => defaultBasicLiteral(node); 154 R visitDoubleLiteral(DoubleLiteral node) => defaultBasicLiteral(node);
156 R visitBoolLiteral(BoolLiteral node) => defaultBasicLiteral(node); 155 R visitBoolLiteral(BoolLiteral node) => defaultBasicLiteral(node);
157 R visitNullLiteral(NullLiteral node) => defaultBasicLiteral(node); 156 R visitNullLiteral(NullLiteral node) => defaultBasicLiteral(node);
158 R visitLet(Let node) => defaultExpression(node); 157 R visitLet(Let node) => defaultExpression(node);
159 R visitBlockExpression(BlockExpression node) => defaultExpression(node);
160 158
161 // Statements 159 // Statements
162 R defaultStatement(Statement node) => defaultTreeNode(node); 160 R defaultStatement(Statement node) => defaultTreeNode(node);
163 R visitInvalidStatement(InvalidStatement node) => defaultStatement(node); 161 R visitInvalidStatement(InvalidStatement node) => defaultStatement(node);
164 R visitExpressionStatement(ExpressionStatement node) => 162 R visitExpressionStatement(ExpressionStatement node) =>
165 defaultStatement(node); 163 defaultStatement(node);
166 R visitBlock(Block node) => defaultStatement(node); 164 R visitBlock(Block node) => defaultStatement(node);
167 R visitEmptyStatement(EmptyStatement node) => defaultStatement(node); 165 R visitEmptyStatement(EmptyStatement node) => defaultStatement(node);
168 R visitAssertStatement(AssertStatement node) => defaultStatement(node); 166 R visitAssertStatement(AssertStatement node) => defaultStatement(node);
169 R visitLabeledStatement(LabeledStatement node) => defaultStatement(node); 167 R visitLabeledStatement(LabeledStatement node) => defaultStatement(node);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 /// By default, recursion stops at this point. 305 /// By default, recursion stops at this point.
308 DartType visitDartType(DartType node) => node; 306 DartType visitDartType(DartType node) => node;
309 307
310 Supertype visitSupertype(Supertype node) => node; 308 Supertype visitSupertype(Supertype node) => node;
311 309
312 TreeNode defaultTreeNode(TreeNode node) { 310 TreeNode defaultTreeNode(TreeNode node) {
313 node.transformChildren(this); 311 node.transformChildren(this);
314 return node; 312 return node;
315 } 313 }
316 } 314 }
OLDNEW
« no previous file with comments | « lib/type_propagation/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698