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

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 3699)
+++ runtime/vm/scanner.cc (working copy)
@@ -186,6 +186,11 @@
}
+static bool IsWhiteSpace(char ch) {
hausner 2012/01/31 18:09:46 This definition of what a whitespace character is
srdjan 2012/01/31 19:26:37 Discussed the difference offline. Removed the meth
+ return ch == '\0' || ch == '\n' || ch == '\r' || ch == ' ' || ch == '\t';
+}
+
+
void Scanner::ConsumeWhiteSpace() {
while (c0_ == ' ' || c0_ == '\t' || c0_ == '\n') {
ReadChar();
@@ -593,7 +598,9 @@
break;
case '+': // + ++ +=
- Recognize(Token::kADD);
+ ReadChar();
+ current_token_.kind =
+ IsWhiteSpace(c0_) ? Token::kADD : Token::kTIGHTADD;
hausner 2012/01/31 18:09:46 Would it not make more sense to reverse the logic
srdjan 2012/01/31 19:26:37 Changed.
if (c0_ == '+') {
Recognize(Token::kINCR);
} else if (c0_ == '=') {

Powered by Google App Engine
This is Rietveld 408576698