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

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

Issue 139903008: List literals in polymer_expressions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library polymer_expressions.visitor; 5 library polymer_expressions.visitor;
6 6
7 import 'expression.dart'; 7 import 'expression.dart';
8 8
9 abstract class Visitor { 9 abstract class Visitor {
10 visit(Expression s) => s.accept(this); 10 visit(Expression s) => s.accept(this);
11 visitEmptyExpression(EmptyExpression e); 11 visitEmptyExpression(EmptyExpression e);
12 visitParenthesizedExpression(ParenthesizedExpression e); 12 visitParenthesizedExpression(ParenthesizedExpression e);
13 visitGetter(Getter i); 13 visitGetter(Getter i);
14 visitIndex(Index i); 14 visitIndex(Index i);
15 visitInvoke(Invoke i); 15 visitInvoke(Invoke i);
16 visitLiteral(Literal l); 16 visitLiteral(Literal l);
17 visitListLiteral(ListLiteral l);
17 visitMapLiteral(MapLiteral l); 18 visitMapLiteral(MapLiteral l);
18 visitMapLiteralEntry(MapLiteralEntry l); 19 visitMapLiteralEntry(MapLiteralEntry l);
19 visitIdentifier(Identifier i); 20 visitIdentifier(Identifier i);
20 visitBinaryOperator(BinaryOperator o); 21 visitBinaryOperator(BinaryOperator o);
21 visitUnaryOperator(UnaryOperator o); 22 visitUnaryOperator(UnaryOperator o);
22 visitTernaryOperator(TernaryOperator o); 23 visitTernaryOperator(TernaryOperator o);
23 visitInExpression(InExpression c); 24 visitInExpression(InExpression c);
24 } 25 }
25 26
26 abstract class RecursiveVisitor extends Visitor { 27 abstract class RecursiveVisitor extends Visitor {
(...skipping 22 matching lines...) Expand all
49 if (i.arguments != null) { 50 if (i.arguments != null) {
50 for (var a in i.arguments) { 51 for (var a in i.arguments) {
51 visit(a); 52 visit(a);
52 } 53 }
53 } 54 }
54 visitExpression(i); 55 visitExpression(i);
55 } 56 }
56 57
57 visitLiteral(Literal l) => visitExpression(l); 58 visitLiteral(Literal l) => visitExpression(l);
58 59
60 visitListLiteral(ListLiteral l) {
61 for (var i in l.items) {
62 visit(i);
63 }
64 visitExpression(l);
65 }
66
59 visitMapLiteral(MapLiteral l) { 67 visitMapLiteral(MapLiteral l) {
60 for (var e in l.entries) { 68 for (var e in l.entries) {
61 visit(e); 69 visit(e);
62 } 70 }
63 visitExpression(l); 71 visitExpression(l);
64 } 72 }
65 73
66 visitMapLiteralEntry(MapLiteralEntry e) { 74 visitMapLiteralEntry(MapLiteralEntry e) {
67 visit(e.key); 75 visit(e.key);
68 visit(e.entryValue); 76 visit(e.entryValue);
(...skipping 19 matching lines...) Expand all
88 visit(o.falseExpr); 96 visit(o.falseExpr);
89 visitExpression(o); 97 visitExpression(o);
90 } 98 }
91 99
92 visitInExpression(InExpression c) { 100 visitInExpression(InExpression c) {
93 visit(c.left); 101 visit(c.left);
94 visit(c.right); 102 visit(c.right);
95 visitExpression(c); 103 visitExpression(c);
96 } 104 }
97 } 105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698