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

Unified Diff: runtime/vm/scanner_test.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_test.cc
===================================================================
--- runtime/vm/scanner_test.cc (revision 3699)
+++ runtime/vm/scanner_test.cc (working copy)
@@ -42,6 +42,7 @@
OS::PrintErr("Token %d: expected kind %s but got %s\n", index,
Token::Name(token_stream[index].kind), Token::Name(kind));
}
+ EXPECT_EQ(kind, token_stream[index].kind);
}
@@ -140,7 +141,7 @@
CheckKind(tokens, 1, Token::kASSIGN);
CheckIdent(tokens, 2, "i");
CheckKind(tokens, 3, Token::kINCR);
- CheckKind(tokens, 4, Token::kADD);
+ CheckKind(tokens, 4, Token::kTIGHTADD);
CheckIdent(tokens, 5, "j");
}
@@ -245,7 +246,7 @@
void NumberLiteral() {
const Scanner::GrowableTokenStream& tokens =
- Scan("5 0x5d 0.3 0.33 1E+12 .42");
+ Scan("5 0x5d 0.3 0.33 1E+12 .42 +5");
CheckKind(tokens, 0, Token::kINTEGER);
CheckKind(tokens, 1, Token::kINTEGER);
@@ -253,7 +254,9 @@
CheckKind(tokens, 3, Token::kDOUBLE);
CheckKind(tokens, 4, Token::kDOUBLE);
CheckKind(tokens, 5, Token::kDOUBLE);
- CheckKind(tokens, 6, Token::kEOS);
+ CheckKind(tokens, 6, Token::kTIGHTADD);
+ CheckKind(tokens, 7, Token::kINTEGER);
+ CheckKind(tokens, 8, Token::kEOS);
}

Powered by Google App Engine
This is Rietveld 408576698