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

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: Update tests. Fix scanner. 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 6b3184ee090686e2230521416db0a7fcacad3ffc..8db9b688c59e5ffdc78fc7deedbd6d9538fdccc1 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,7 @@ class NodeListener extends ElementListener {
void handleBinaryExpression(Token token) {
Node argument = popNode();
Node receiver = popNode();
- if (token.stringValue === '.') {
+ if (token.stringValue === '.' || token.stringValue == '..') {
ahe 2012/04/16 08:55:23 Please store the stringValue in a temporary.
Lasse Reichstein Nielsen 2012/04/16 12:41:38 Done.
if (argument is !Send) internalError(node: argument);
if (argument.asSend().receiver !== null) internalError(node: argument);
if (argument is SendSet) internalError(node: argument);
@@ -1021,6 +1027,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();

Powered by Google App Engine
This is Rietveld 408576698