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

Unified Diff: lib/compiler/implementation/tree/nodes.dart

Issue 9958009: Implement cascaded calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/tree/visitors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/tree/nodes.dart
diff --git a/lib/compiler/implementation/tree/nodes.dart b/lib/compiler/implementation/tree/nodes.dart
index 2074ddc0bdcb282fa71d4dd06298783fd695ea64..7bb165d10a1aae3893977d03c7cafd6da486b52e 100644
--- a/lib/compiler/implementation/tree/nodes.dart
+++ b/lib/compiler/implementation/tree/nodes.dart
@@ -5,6 +5,8 @@
interface Visitor<R> {
R visitBlock(Block node);
R visitBreakStatement(BreakStatement node);
+ R visitCascade(Cascade node);
+ R visitCascadeReceiver(CascadeReceiver node);
R visitCatchBlock(CatchBlock node);
R visitClassNode(ClassNode node);
R visitConditional(Conditional node);
@@ -108,6 +110,8 @@ class Node implements Hashable {
Block asBlock() => null;
BreakStatement asBreakStatement() => null;
+ Cascade asCascade() => null;
+ CascadeReceiver asCascadeReceiver() => null;
CatchBlock asCatchBlock() => null;
ClassNode asClassNode() => null;
Conditional asConditional() => null;
@@ -1564,6 +1568,39 @@ class TryStatement extends Statement {
}
}
+class Cascade extends Node {
+ final Node expression;
+ Cascade(this.expression);
+
+ Cascade asCascade() => this;
+ accept(Visitor visitor) => visitor.visitCascade(this);
+
+ void visitChildren(Visitor visitor) {
+ expression.accept(visitor);
+ }
+
+ Token getBeginToken() => expression.getBeginToken();
+
+ Token getEndToken() => expression.getEndToken();
+}
+
+class CascadeReceiver extends Node {
+ final Node expression;
+ final Token cascadeOperator;
+ CascadeReceiver(this.expression, this.cascadeOperator);
+
+ CascadeReceiver asCascadeReceiver() => this;
+ accept(Visitor visitor) => visitor.visitCascadeReceiver(this);
+
+ void visitChildren(Visitor visitor) {
+ expression.accept(visitor);
+ }
+
+ Token getBeginToken() => expression.getBeginToken();
+
+ Token getEndToken() => expression.getEndToken();
+}
+
class CatchBlock extends Node {
final NodeList formals;
final Block block;
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/tree/visitors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698