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

Unified Diff: lib/compiler/implementation/scanner/token.dart

Issue 10236005: Fix small problems with precedence of cascades. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make withoutCascade flag local. 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/token.dart
diff --git a/lib/compiler/implementation/scanner/token.dart b/lib/compiler/implementation/scanner/token.dart
index f94c998f8a312c09f41cd4b392b0eb7e0d17288d..ddd921b074745f311777c71ec04380a0e8b2f4a4 100644
--- a/lib/compiler/implementation/scanner/token.dart
+++ b/lib/compiler/implementation/scanner/token.dart
@@ -249,9 +249,10 @@ final PrecedenceInfo PERIOD_PERIOD_PERIOD_INFO =
PERIOD_PERIOD_PERIOD_TOKEN);
/**
- * The cascade operator has the lowest precedence of any operator.
+ * The cascade operator has the lowest precedence of any operator
+ * except assignment.
*/
-final int CASCADE_PRECEDENCE = 1;
+final int CASCADE_PRECEDENCE = 2;
final PrecedenceInfo PERIOD_PERIOD_INFO =
const PrecedenceInfo(const SourceString('..'), CASCADE_PRECEDENCE,
PERIOD_PERIOD_TOKEN);
@@ -283,7 +284,7 @@ final PrecedenceInfo COMMA_INFO =
const PrecedenceInfo(const SourceString(','), 0, COMMA_TOKEN);
// Assignment operators.
-final int ASSIGNMENT_PRECEDENCE = 2;
+final int ASSIGNMENT_PRECEDENCE = 1;
final PrecedenceInfo AMPERSAND_EQ_INFO =
const PrecedenceInfo(const SourceString('&='),
ASSIGNMENT_PRECEDENCE, AMPERSAND_EQ_TOKEN);

Powered by Google App Engine
This is Rietveld 408576698