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

Unified Diff: lib/compiler/implementation/scanner/listener.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
Index: lib/compiler/implementation/scanner/listener.dart
diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart
index 343bc5156a52e39edaf6b7f0e9caf4d6d76fb668..e7ddd63e6641d159d7b2100349f62fad7837aff5 100644
--- a/lib/compiler/implementation/scanner/listener.dart
+++ b/lib/compiler/implementation/scanner/listener.dart
@@ -17,6 +17,12 @@ class Listener {
void endBlock(int count, Token beginToken, Token endToken) {
}
+ void beginCascade(Token token) {
+ }
+
+ void endCascade() {
+ }
+
void beginClassBody(Token token) {
}
@@ -1010,7 +1016,8 @@ class NodeListener extends ElementListener {
void handleBinaryExpression(Token token) {
Node argument = popNode();
Node receiver = popNode();
- if (token.stringValue === '.') {
+ String tokenString = token.stringValue;
+ if (tokenString === '.' || tokenString === '..') {
if (argument is !Send) internalError(node: argument);
if (argument.asSend().receiver !== null) internalError(node: argument);
if (argument is SendSet) internalError(node: argument);
@@ -1021,6 +1028,14 @@ class NodeListener extends ElementListener {
}
}
+ void beginCascade(Token token) {
+ pushNode(new CascadeReceiver(popNode(), token));
+ }
+
+ void endCascade() {
+ pushNode(new Cascade(popNode()));
+ }
+
void handleAssignmentExpression(Token token) {
Node arg = popNode();
Node node = popNode();
« no previous file with comments | « lib/compiler/implementation/scanner/array_based_scanner.dart ('k') | lib/compiler/implementation/scanner/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698