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

Unified Diff: runtime/vm/parser.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/object.cc ('k') | runtime/vm/scanner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 24043)
+++ runtime/vm/parser.cc (working copy)
@@ -6806,8 +6806,7 @@
static bool IsPrefixOperator(Token::Kind token) {
- return (token == Token::kTIGHTADD) || // Valid for literals only!
- (token == Token::kSUB) ||
+ return (token == Token::kSUB) ||
(token == Token::kNOT) ||
(token == Token::kBIT_NOT);
}
@@ -6920,9 +6919,6 @@
while (current_preced >= min_preced) {
while (Token::Precedence(CurrentToken()) == current_preced) {
Token::Kind op_kind = CurrentToken();
- if (op_kind == Token::kTIGHTADD) {
- op_kind = Token::kADD;
- }
const intptr_t op_pos = TokenPos();
ConsumeToken();
AstNode* right_operand = NULL;
@@ -7331,13 +7327,7 @@
}
ConsumeToken();
expr = ParseUnaryExpr();
- if (unary_op == Token::kTIGHTADD) {
- // kTIGHADD is added only in front of a number literal.
- if (!expr->IsLiteralNode()) {
- ErrorMsg(op_pos, "unexpected operator '+'");
- }
- // Expression is the literal itself.
- } else if (expr->IsPrimaryNode() && (expr->AsPrimaryNode()->IsSuper())) {
+ if (expr->IsPrimaryNode() && (expr->AsPrimaryNode()->IsSuper())) {
expr = BuildUnarySuperOperator(unary_op, expr->AsPrimaryNode());
} else {
expr = UnaryOpNode::UnaryOpOrLiteral(op_pos, unary_op, expr);
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698