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

Unified Diff: pkg/polymer_expressions/lib/parser.dart

Issue 213523004: Fix precedence of ternary operators in polymer expressions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « no previous file | pkg/polymer_expressions/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer_expressions/lib/parser.dart
diff --git a/pkg/polymer_expressions/lib/parser.dart b/pkg/polymer_expressions/lib/parser.dart
index bf8dd66b87071b4ed9a6123fa54d2df9a4c8d312..411c7ae0be5c5827bdc0b566ef37bf2e1830f8f8 100644
--- a/pkg/polymer_expressions/lib/parser.dart
+++ b/pkg/polymer_expressions/lib/parser.dart
@@ -66,11 +66,9 @@ class Parser {
left = _makeInvokeOrGetter(left, right);
} else if (_token.kind == KEYWORD_TOKEN && _token.value == 'in') {
left = _parseComprehension(left);
- } else if (_token.kind == OPERATOR_TOKEN && _token.value == '?') {
- left = _parseTernary(left);
} else if (_token.kind == OPERATOR_TOKEN
&& _token.precedence >= precedence) {
- left = _parseBinary(left);
+ left = _token.value == '?' ? _parseTernary(left) : _parseBinary(left);
} else {
break;
}
« no previous file with comments | « no previous file | pkg/polymer_expressions/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698