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

Side by Side Diff: pkg/kernel/lib/visitor.dart

Issue 2561723003: Merge kernel closure conversion into the Dart SDK (Closed)
Patch Set: Remove path constraint Created 4 years 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 | « pkg/kernel/lib/type_propagation/type_propagation.dart ('k') | pkg/kernel/pubspec.yaml » ('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) 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 class MemberReferenceVisitor<R> { 229 class MemberReferenceVisitor<R> {
230 R defaultMemberReference(Member node) => null; 230 R defaultMemberReference(Member node) => null;
231 231
232 R visitFieldReference(Field node) => defaultMemberReference(node); 232 R visitFieldReference(Field node) => defaultMemberReference(node);
233 R visitConstructorReference(Constructor node) => defaultMemberReference(node); 233 R visitConstructorReference(Constructor node) => defaultMemberReference(node);
234 R visitProcedureReference(Procedure node) => defaultMemberReference(node); 234 R visitProcedureReference(Procedure node) => defaultMemberReference(node);
235 } 235 }
236 236
237 class Visitor<R> extends TreeVisitor<R> 237 class Visitor<R> extends TreeVisitor<R>
238 implements 238 implements DartTypeVisitor<R>, MemberReferenceVisitor<R> {
239 DartTypeVisitor<R>,
240 MemberReferenceVisitor<R> {
241 /// The catch-all case, except for references. 239 /// The catch-all case, except for references.
242 R defaultNode(Node node) => null; 240 R defaultNode(Node node) => null;
243 R defaultTreeNode(TreeNode node) => defaultNode(node); 241 R defaultTreeNode(TreeNode node) => defaultNode(node);
244 242
245 /// Inferred values 243 /// Inferred values
246 R visitInferredValue(InferredValue node) => defaultNode(node); 244 R visitInferredValue(InferredValue node) => defaultNode(node);
247 245
248 // DartTypes 246 // DartTypes
249 R defaultDartType(DartType node) => defaultNode(node); 247 R defaultDartType(DartType node) => defaultNode(node);
250 R visitInvalidType(InvalidType node) => defaultDartType(node); 248 R visitInvalidType(InvalidType node) => defaultDartType(node);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 /// By default, recursion stops at this point. 304 /// By default, recursion stops at this point.
307 DartType visitDartType(DartType node) => node; 305 DartType visitDartType(DartType node) => node;
308 306
309 Supertype visitSupertype(Supertype node) => node; 307 Supertype visitSupertype(Supertype node) => node;
310 308
311 TreeNode defaultTreeNode(TreeNode node) { 309 TreeNode defaultTreeNode(TreeNode node) {
312 node.transformChildren(this); 310 node.transformChildren(this);
313 return node; 311 return node;
314 } 312 }
315 } 313 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/type_propagation/type_propagation.dart ('k') | pkg/kernel/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698