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

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

Issue 141703024: Refactor of PolymerExpressions. Adds "as" expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: syntax, bindings, and globals tests now passing in Safari Created 6 years, 6 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 visitListLiteral(ListLiteral l);
18 visitMapLiteral(MapLiteral l); 18 visitMapLiteral(MapLiteral l);
19 visitMapLiteralEntry(MapLiteralEntry l); 19 visitMapLiteralEntry(MapLiteralEntry l);
20 visitIdentifier(Identifier i); 20 visitIdentifier(Identifier i);
21 visitBinaryOperator(BinaryOperator o); 21 visitBinaryOperator(BinaryOperator o);
22 visitUnaryOperator(UnaryOperator o); 22 visitUnaryOperator(UnaryOperator o);
23 visitTernaryOperator(TernaryOperator o); 23 visitTernaryOperator(TernaryOperator o);
24 visitInExpression(InExpression c); 24 visitInExpression(InExpression c);
25 visitAsExpression(AsExpression c);
25 } 26 }
26 27
27 class RecursiveVisitor extends Visitor { 28 class RecursiveVisitor extends Visitor {
28 preVisitExpression(Expression e) {} 29 preVisitExpression(Expression e) {}
29 visitExpression(Expression e) {} 30 visitExpression(Expression e) {}
30 31
31 visitEmptyExpression(EmptyExpression e) { 32 visitEmptyExpression(EmptyExpression e) {
32 preVisitExpression(e); 33 preVisitExpression(e);
33 visitExpression(e); 34 visitExpression(e);
34 } 35 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 visit(o.falseExpr); 117 visit(o.falseExpr);
117 visitExpression(o); 118 visitExpression(o);
118 } 119 }
119 120
120 visitInExpression(InExpression c) { 121 visitInExpression(InExpression c) {
121 preVisitExpression(c); 122 preVisitExpression(c);
122 visit(c.left); 123 visit(c.left);
123 visit(c.right); 124 visit(c.right);
124 visitExpression(c); 125 visitExpression(c);
125 } 126 }
127
128 visitAsExpression(AsExpression c) {
129 visit(c.left);
130 visit(c.right);
131 visitExpression(c);
132 }
126 } 133 }
OLDNEW
« no previous file with comments | « pkg/polymer_expressions/lib/tokenizer.dart ('k') | pkg/polymer_expressions/test/bindings_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698