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

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

Issue 10091028: Fix type warnings and a few other warnings, and probably even an error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/tracer.dart ('k') | lib/compiler/implementation/tree/unparser.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 f43005561fe3bb36c01ec209713dd00b4af0966c..eb98367a92dcb5626d6f712f5b9643d6f3f21b98 100644
--- a/lib/compiler/implementation/tree/nodes.dart
+++ b/lib/compiler/implementation/tree/nodes.dart
@@ -1372,15 +1372,16 @@ class SwitchCase extends Node {
// Skip past the label: <Identifier> ':'.
token = token.next.next;
}
- Link<Token> recursiveGetCases(Token token, Link<Expression> expressions) {
- if (token.stringValue === 'case') {
- Token colon = expressions.head.getEndToken().next;
- return new Link<Token>(token,
- recursiveGetCases(colon.next, expressions.tail));
- }
- return const EmptyLink<Token>();
+ LinkBuilder<Token> builder = new LinkBuilder<Token>();
+ Link<Expression> link = expressions.nodes;
+ while (token.stringValue === 'case') {
+ assert(token.next === link.head.getBeginToken(0));
+ builder.addLast(token);
+ Token colon = link.head.getEndToken().next;
+ token = colon.next;
+ link = link.tail;
}
- return recursiveGetCases(token, expressions.nodes);
+ return builder.toLink();
}
}
@@ -1568,8 +1569,8 @@ class TryStatement extends Statement {
}
}
-class Cascade extends Node {
- final Node expression;
+class Cascade extends Expression {
+ final Expression expression;
Cascade(this.expression);
Cascade asCascade() => this;
@@ -1584,8 +1585,8 @@ class Cascade extends Node {
Token getEndToken() => expression.getEndToken();
}
-class CascadeReceiver extends Node {
- final Node expression;
+class CascadeReceiver extends Expression {
+ final Expression expression;
final Token cascadeOperator;
CascadeReceiver(this.expression, this.cascadeOperator);
« no previous file with comments | « lib/compiler/implementation/ssa/tracer.dart ('k') | lib/compiler/implementation/tree/unparser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698