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

Issue 9264051: Fix for bug 1229: Unary operator plus is not allowed ... except for literals. (Closed)

Created:
8 years, 10 months ago by srdjan
Modified:
8 years, 10 months ago
Reviewers:
hausner
CC:
reviews_dartlang.org, scheglov
Visibility:
Public.

Description

Fix for bug 1229: Unary operator plus is not allowed ... except for literals. Add tests for incorrect literals, e.g. "+ 5". Added a temporary token kTIGHTADD that represents an ADD not terminated by a whitespace. It is temporary and eliminated in the parser (code generator ot AST do not see it). It is used to recognize correct literals. Committed: https://code.google.com/p/dart/source/detail?r=3745

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 11

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Total comments: 2

Patch Set 10 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -13 lines) Patch
M runtime/lib/math.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -2 lines 0 comments Download
M runtime/vm/ast.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/bigint_operations.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 3 4 5 6 7 8 9 3 chunks +16 lines, -3 lines 0 comments Download
M runtime/vm/scanner.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/scanner.cc View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -1 line 0 comments Download
M runtime/vm/scanner_test.cc View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -2 lines 0 comments Download
M runtime/vm/token.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M tests/language/language.status View 1 2 3 4 5 6 7 8 9 4 chunks +3 lines, -3 lines 0 comments Download
M tests/language/language-leg.status View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
A tests/language/src/LiteralUnaryPlusTest.dart View 1 2 3 4 5 6 7 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
srdjan
8 years, 10 months ago (2012-01-31 00:57:20 UTC) #1
srdjan
8 years, 10 months ago (2012-01-31 01:24:45 UTC) #2
hausner
At the very least the case +"foo" needs to be handled, but see my suggestion ...
8 years, 10 months ago (2012-01-31 18:09:45 UTC) #3
srdjan
Thanks for the comments. Adressed all, please have another look. https://chromiumcodereview.appspot.com/9264051/diff/1008/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://chromiumcodereview.appspot.com/9264051/diff/1008/runtime/vm/parser.cc#newcode5692 ...
8 years, 10 months ago (2012-01-31 19:26:37 UTC) #4
hausner
LGTM w/one nit. https://chromiumcodereview.appspot.com/9264051/diff/12015/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://chromiumcodereview.appspot.com/9264051/diff/12015/runtime/vm/parser.cc#newcode5671 runtime/vm/parser.cc:5671: ErrorMsg("unexpected operator '+'"); Would still be ...
8 years, 10 months ago (2012-01-31 19:57:09 UTC) #5
srdjan
8 years, 10 months ago (2012-01-31 20:05:28 UTC) #6
https://chromiumcodereview.appspot.com/9264051/diff/12015/runtime/vm/parser.cc
File runtime/vm/parser.cc (right):

https://chromiumcodereview.appspot.com/9264051/diff/12015/runtime/vm/parser.c...
runtime/vm/parser.cc:5671: ErrorMsg("unexpected operator '+'");
On 2012/01/31 19:57:09, hausner wrote:
> Would still be nice to print the error at token position op_pos.

Done.

Powered by Google App Engine
This is Rietveld 408576698