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

Issue 8441001: Prefix string literal must be identifier (Closed)

Created:
9 years, 1 month ago by codefu
Modified:
9 years, 1 month ago
Reviewers:
mmendez, Ivan Posva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add negative test for invalid prefixes. Update dartc's parser to validate identifier in string literal. Add new error code. http://code.google.com/p/dart/issues/detail?id=266 R=mmendez BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=1099

Patch Set 1 #

Total comments: 8

Patch Set 2 : Updates #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -0 lines) Patch
M compiler/java/com/google/dart/compiler/parser/DartParser.java View 1 1 chunk +5 lines, -0 lines 1 comment Download
M compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java View 1 1 chunk +1 line, -0 lines 0 comments Download
M tests/language/language.status View 1 1 chunk +4 lines, -0 lines 0 comments Download
A tests/language/src/Prefix18NegativeTest_1.dart View 1 1 chunk +11 lines, -0 lines 0 comments Download
A tests/language/src/Prefix18NegativeTest_2.dart View 1 1 chunk +13 lines, -0 lines 0 comments Download
A tests/language/src/Prefix18NegativeTest_3.dart View 1 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
codefu
9 years, 1 month ago (2011-11-01 21:17:28 UTC) #1
mmendez
LGTM with comments http://codereview.chromium.org/8441001/diff/1/compiler/java/com/google/dart/compiler/parser/DartParser.java File compiler/java/com/google/dart/compiler/parser/DartParser.java (right): http://codereview.chromium.org/8441001/diff/1/compiler/java/com/google/dart/compiler/parser/DartParser.java#newcode365 compiler/java/com/google/dart/compiler/parser/DartParser.java:365: private boolean VerifyStringIdentifier(String id) { Nit: ...
9 years, 1 month ago (2011-11-02 13:45:58 UTC) #2
codefu
http://codereview.chromium.org/8441001/diff/1/compiler/java/com/google/dart/compiler/parser/DartParser.java File compiler/java/com/google/dart/compiler/parser/DartParser.java (right): http://codereview.chromium.org/8441001/diff/1/compiler/java/com/google/dart/compiler/parser/DartParser.java#newcode365 compiler/java/com/google/dart/compiler/parser/DartParser.java:365: private boolean VerifyStringIdentifier(String id) { On 2011/11/02 13:45:58, mmendez ...
9 years, 1 month ago (2011-11-02 14:32:57 UTC) #3
Ivan Posva
This new test needs split up into multiple files. -Ivan http://codereview.chromium.org/8441001/diff/1/tests/language/src/Prefix18NegativeTest.dart File tests/language/src/Prefix18NegativeTest.dart (right): http://codereview.chromium.org/8441001/diff/1/tests/language/src/Prefix18NegativeTest.dart#newcode8 ...
9 years, 1 month ago (2011-11-02 15:20:25 UTC) #4
codefu
http://codereview.chromium.org/8441001/diff/1/tests/language/src/Prefix18NegativeTest.dart File tests/language/src/Prefix18NegativeTest.dart (right): http://codereview.chromium.org/8441001/diff/1/tests/language/src/Prefix18NegativeTest.dart#newcode8 tests/language/src/Prefix18NegativeTest.dart:8: #import("library1.dart", prefix:"lib1.invalid"); On 2011/11/02 15:20:25, Ivan Posva wrote: > ...
9 years, 1 month ago (2011-11-02 15:22:19 UTC) #5
codefu
http://codereview.chromium.org/8441001/diff/4003/compiler/java/com/google/dart/compiler/parser/DartParser.java File compiler/java/com/google/dart/compiler/parser/DartParser.java (right): http://codereview.chromium.org/8441001/diff/4003/compiler/java/com/google/dart/compiler/parser/DartParser.java#newcode381 compiler/java/com/google/dart/compiler/parser/DartParser.java:381: if(id == null || !id.matches("[_a-zA-Z]([_A-Za-z0-9]*)")) { Looking further at ...
9 years, 1 month ago (2011-11-02 16:04:59 UTC) #6
mmendez
LGTM On 2011/11/02 16:04:59, codefu wrote: > http://codereview.chromium.org/8441001/diff/4003/compiler/java/com/google/dart/compiler/parser/DartParser.java > File compiler/java/com/google/dart/compiler/parser/DartParser.java (right): > > http://codereview.chromium.org/8441001/diff/4003/compiler/java/com/google/dart/compiler/parser/DartParser.java#newcode381 ...
9 years, 1 month ago (2011-11-02 16:52:01 UTC) #7
Ivan Posva
Negative tests need to end with "NegativeTest.dart", your tests should be failing all over the ...
9 years, 1 month ago (2011-11-02 16:54:58 UTC) #8
codefu
On 2011/11/02 16:54:58, Ivan Posva wrote: > Negative tests need to end with "NegativeTest.dart", your ...
9 years, 1 month ago (2011-11-02 16:58:49 UTC) #9
mmendez
9 years, 1 month ago (2011-11-02 17:00:50 UTC) #10
Oh, that's right -- the naming scheme.  John, Ivan is correct the test needs to
end in NegativeTest.dart.  

Is there something that the presubmit can do to check that tests listed in the
status file were not even run?

On 2011/11/02 16:54:58, Ivan Posva wrote:
> Negative tests need to end with "NegativeTest.dart", your tests should be
> failing all over the place. Actually since they do not end with "Test.dart"
they
> are not even run.
> 
> Please fix before committing.
> 
> -Ivan
> 
> 
> 
> On 2011/11/02 16:52:01, mmendez wrote:
> > LGTM
> > 
> > On 2011/11/02 16:04:59, codefu wrote:
> > >
> >
>
http://codereview.chromium.org/8441001/diff/4003/compiler/java/com/google/dar...
> > > File compiler/java/com/google/dart/compiler/parser/DartParser.java
(right):
> > > 
> > >
> >
>
http://codereview.chromium.org/8441001/diff/4003/compiler/java/com/google/dar...
> > > compiler/java/com/google/dart/compiler/parser/DartParser.java:381: if(id
==
> > null
> > > || !id.matches("[_a-zA-Z]([_A-Za-z0-9]*)")) {
> > > Looking further at the spec and searching for just "$", it appears
> identifiers
> > > cannot have the $ in them if they are in a string; hence this
> simplification.

Powered by Google App Engine
This is Rietveld 408576698