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

Unified Diff: runtime/vm/scanner.cc

Issue 17103002: Remove support for + prefix in number literals (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « runtime/vm/parser.cc ('k') | runtime/vm/scanner_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scanner.cc
===================================================================
--- runtime/vm/scanner.cc (revision 24043)
+++ runtime/vm/scanner.cc (working copy)
@@ -189,7 +189,7 @@
return true;
}
if ((tokens.length() == 3) &&
- ((tokens[0].kind == Token::kTIGHTADD) ||
+ ((tokens[0].kind == Token::kADD) ||
(tokens[0].kind == Token::kSUB)) &&
(tokens[1].kind == literal_kind) &&
(tokens[2].kind == Token::kEOS)) {
@@ -197,7 +197,7 @@
if ((tokens[0].offset + 1) != tokens[1].offset) {
return false;
}
- *is_positive = tokens[0].kind == Token::kTIGHTADD;
+ *is_positive = tokens[0].kind == Token::kADD;
*value = tokens[1].literal;
return true;
}
@@ -639,15 +639,8 @@
break;
case '+': // + ++ +=
- ReadChar();
- current_token_.kind =
- IsNumberStart(c0_) ? Token::kTIGHTADD : Token::kADD;
- // Unary + is not allowed for hexadecimal integers, so treat the
- // + as a binary operator.
- if ((c0_ == '0') &&
- ((LookaheadChar(1) == 'x') || (LookaheadChar(1) == 'X'))) {
- current_token_.kind = Token::kADD;
- } else if (c0_ == '+') {
+ Recognize(Token::kADD);
+ if (c0_ == '+') {
Recognize(Token::kINCR);
} else if (c0_ == '=') {
Recognize(Token::kASSIGN_ADD);
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/scanner_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698