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

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

Issue 10870066: Support unary - operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix unparser to handle that negate is no longer a keyword. Created 8 years, 4 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: dart/lib/compiler/implementation/scanner/parser.dart
diff --git a/dart/lib/compiler/implementation/scanner/parser.dart b/dart/lib/compiler/implementation/scanner/parser.dart
index fab984060a33b22d0c80021186846eae0c0d2df2..adf0646b577c3584f77ad01c1738e11950c09c71 100644
--- a/dart/lib/compiler/implementation/scanner/parser.dart
+++ b/dart/lib/compiler/implementation/scanner/parser.dart
@@ -725,7 +725,9 @@ class Parser {
Token parseOperatorName(Token token) {
assert(optional('operator', token));
- if (isUserDefinableOperator(token.next.stringValue)) {
+ if (isUserDefinableOperator(token.next.stringValue)
+ // TODO(ahe): Remove negate.
+ || token.next.value == const SourceString("negate")) {
Token operator = token;
token = token.next;
listener.handleOperatorName(operator, token);
« no previous file with comments | « dart/lib/compiler/implementation/scanner/keyword.dart ('k') | dart/lib/compiler/implementation/scanner/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698