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

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

Issue 2740273003: Add visitor with additional argument for Statement nodes (Closed)
Patch Set: Created 3 years, 9 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 | « pkg/kernel/lib/ast.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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 R visitIntLiteral(IntLiteral node, arg) => defaultBasicLiteral(node, arg); 374 R visitIntLiteral(IntLiteral node, arg) => defaultBasicLiteral(node, arg);
375 R visitDoubleLiteral(DoubleLiteral node, arg) => 375 R visitDoubleLiteral(DoubleLiteral node, arg) =>
376 defaultBasicLiteral(node, arg); 376 defaultBasicLiteral(node, arg);
377 R visitBoolLiteral(BoolLiteral node, arg) => defaultBasicLiteral(node, arg); 377 R visitBoolLiteral(BoolLiteral node, arg) => defaultBasicLiteral(node, arg);
378 R visitNullLiteral(NullLiteral node, arg) => defaultBasicLiteral(node, arg); 378 R visitNullLiteral(NullLiteral node, arg) => defaultBasicLiteral(node, arg);
379 R visitLet(Let node, arg) => defaultExpression(node, arg); 379 R visitLet(Let node, arg) => defaultExpression(node, arg);
380 R visitLoadLibrary(LoadLibrary node, arg) => defaultExpression(node, arg); 380 R visitLoadLibrary(LoadLibrary node, arg) => defaultExpression(node, arg);
381 R visitCheckLibraryIsLoaded(CheckLibraryIsLoaded node, arg) => 381 R visitCheckLibraryIsLoaded(CheckLibraryIsLoaded node, arg) =>
382 defaultExpression(node, arg); 382 defaultExpression(node, arg);
383 } 383 }
384
385 abstract class StatementVisitor1<R> {
386 R defaultStatement(Statement node, arg) => null;
387
388 R visitInvalidStatement(InvalidStatement node, arg) =>
389 defaultStatement(node, arg);
390 R visitExpressionStatement(ExpressionStatement node, arg) =>
391 defaultStatement(node, arg);
392 R visitBlock(Block node, arg) => defaultStatement(node, arg);
393 R visitEmptyStatement(EmptyStatement node, arg) =>
394 defaultStatement(node, arg);
395 R visitAssertStatement(AssertStatement node, arg) =>
396 defaultStatement(node, arg);
397 R visitLabeledStatement(LabeledStatement node, arg) =>
398 defaultStatement(node, arg);
399 R visitBreakStatement(BreakStatement node, arg) =>
400 defaultStatement(node, arg);
401 R visitWhileStatement(WhileStatement node, arg) =>
402 defaultStatement(node, arg);
403 R visitDoStatement(DoStatement node, arg) => defaultStatement(node, arg);
404 R visitForStatement(ForStatement node, arg) => defaultStatement(node, arg);
405 R visitForInStatement(ForInStatement node, arg) =>
406 defaultStatement(node, arg);
407 R visitSwitchStatement(SwitchStatement node, arg) =>
408 defaultStatement(node, arg);
409 R visitContinueSwitchStatement(ContinueSwitchStatement node, arg) =>
410 defaultStatement(node, arg);
411 R visitIfStatement(IfStatement node, arg) => defaultStatement(node, arg);
412 R visitReturnStatement(ReturnStatement node, arg) =>
413 defaultStatement(node, arg);
414 R visitTryCatch(TryCatch node, arg) => defaultStatement(node, arg);
415 R visitTryFinally(TryFinally node, arg) => defaultStatement(node, arg);
416 R visitYieldStatement(YieldStatement node, arg) =>
417 defaultStatement(node, arg);
418 R visitVariableDeclaration(VariableDeclaration node, arg) =>
419 defaultStatement(node, arg);
420 R visitFunctionDeclaration(FunctionDeclaration node, arg) =>
421 defaultStatement(node, arg);
422 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/ast.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698