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

Unified Diff: runtime/vm/scanner.cc

Issue 9264051: Fix for bug 1229: Unary operator plus is not allowed ... except for literals. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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: runtime/vm/scanner.cc
===================================================================
--- runtime/vm/scanner.cc (revision 3739)
+++ runtime/vm/scanner.cc (working copy)
@@ -118,6 +118,11 @@
}
+bool Scanner::IsNumberStart(int32_t ch) {
+ return IsDecimalDigit(ch) || ch == '.';
+}
+
+
bool Scanner::IsHexDigit(int32_t c) {
return IsDecimalDigit(c)
|| (('A' <= c) && (c <= 'F'))
@@ -593,7 +598,9 @@
break;
case '+': // + ++ +=
- Recognize(Token::kADD);
+ ReadChar();
+ current_token_.kind =
+ IsNumberStart(c0_) ? Token::kTIGHTADD : Token::kADD;
if (c0_ == '+') {
Recognize(Token::kINCR);
} else if (c0_ == '=') {
« runtime/vm/parser.cc ('K') | « runtime/vm/scanner.h ('k') | runtime/vm/scanner_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698