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

Issue 9271037: Inserted string validation as separate task in compiler. (Closed)

Created:
8 years, 11 months ago by Lasse Reichstein Nielsen
Modified:
8 years, 11 months ago
Reviewers:
karlklose, ahe
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Inserted string validation as separate task in compiler. A LiteralString that has been validated now has a QuotedString on it that records extra information (string without quotes, quoting style and string length). Later stages expect that QuotedString to be there and the string to be valid. Committed: https://code.google.com/p/dart/source/detail?r=3650

Patch Set 1 #

Total comments: 25

Patch Set 2 : Addressed review comments. #

Total comments: 2

Patch Set 3 : Addressed offline comments. #

Total comments: 34

Patch Set 4 : Addressed review comments. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+492 lines, -358 lines) Patch
M frog/leg/leg.dart View 1 1 chunk +1 line, -0 lines 0 comments Download
M frog/leg/scanner/listener.dart View 1 2 3 7 chunks +89 lines, -30 lines 2 comments Download
M frog/leg/scanner/parser.dart View 1 2 4 chunks +13 lines, -12 lines 0 comments Download
M frog/leg/scanner/scannerlib.dart View 1 1 chunk +1 line, -0 lines 0 comments Download
M frog/leg/ssa/builder.dart View 2 chunks +6 lines, -25 lines 0 comments Download
M frog/leg/ssa/codegen.dart View 1 2 3 2 chunks +103 lines, -5 lines 0 comments Download
M frog/leg/ssa/nodes.dart View 1 chunk +0 lines, -275 lines 0 comments Download
A frog/leg/string_validator.dart View 1 2 3 1 chunk +166 lines, -0 lines 0 comments Download
M frog/leg/tree/nodes.dart View 1 1 chunk +85 lines, -1 line 0 comments Download
M frog/leg/tree/tree.dart View 1 chunk +1 line, -0 lines 0 comments Download
M frog/leg/util/characters.dart View 1 2 3 1 chunk +23 lines, -1 line 0 comments Download
M frog/leg/warnings.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M frog/tests/leg_only/src/StringEscapeTest.dart View 1 2 3 1 chunk +3 lines, -4 lines 0 comments Download
M tests/language/language-leg.status View 1 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Lasse Reichstein Nielsen
8 years, 11 months ago (2012-01-25 07:45:48 UTC) #1
ahe
Initial comments. I think this is a great idea, but I'd like this to be ...
8 years, 11 months ago (2012-01-25 08:18:52 UTC) #2
Lasse Reichstein Nielsen
On 2012/01/25 08:18:52, ahe wrote: > Initial comments. > > I think this is a ...
8 years, 11 months ago (2012-01-25 08:31:47 UTC) #3
ahe
More comments. https://chromiumcodereview.appspot.com/9271037/diff/1/frog/leg/leg.dart File frog/leg/leg.dart (right): https://chromiumcodereview.appspot.com/9271037/diff/1/frog/leg/leg.dart#newcode15 frog/leg/leg.dart:15: #import('util/characters.dart'); I'd like to avoid this import. ...
8 years, 11 months ago (2012-01-25 08:39:44 UTC) #4
karlklose
The functionality LGTM, but I agree with Peter that the validation should happen during an ...
8 years, 11 months ago (2012-01-25 08:47:26 UTC) #5
Lasse Reichstein Nielsen
Please take a new look. https://chromiumcodereview.appspot.com/9271037/diff/1/frog/leg/leg.dart File frog/leg/leg.dart (right): https://chromiumcodereview.appspot.com/9271037/diff/1/frog/leg/leg.dart#newcode15 frog/leg/leg.dart:15: #import('util/characters.dart'); On 2012/01/25 08:39:44, ...
8 years, 11 months ago (2012-01-26 10:14:20 UTC) #6
Lasse Reichstein Nielsen
Changed based on offline discussions. https://chromiumcodereview.appspot.com/9271037/diff/1014/frog/leg/scanner/listener.dart File frog/leg/scanner/listener.dart (right): https://chromiumcodereview.appspot.com/9271037/diff/1014/frog/leg/scanner/listener.dart#newcode480 frog/leg/scanner/listener.dart:480: } Abstracted this block ...
8 years, 11 months ago (2012-01-26 12:06:31 UTC) #7
ahe
LGTM! Very nice. Cheers, Peter https://chromiumcodereview.appspot.com/9271037/diff/2002/frog/leg/scanner/listener.dart File frog/leg/scanner/listener.dart (right): https://chromiumcodereview.appspot.com/9271037/diff/2002/frog/leg/scanner/listener.dart#newcode155 frog/leg/scanner/listener.dart:155: void beginScriptTag(Token token) { ...
8 years, 11 months ago (2012-01-26 19:24:27 UTC) #8
karlklose
LGTM. https://chromiumcodereview.appspot.com/9271037/diff/2002/frog/leg/compiler.dart File frog/leg/compiler.dart (right): https://chromiumcodereview.appspot.com/9271037/diff/2002/frog/leg/compiler.dart#newcode80 frog/leg/compiler.dart:80: optimizer, generator, emitter, compileTimeConstantHandler]; This could go back ...
8 years, 11 months ago (2012-01-27 09:11:59 UTC) #9
Lasse Reichstein Nielsen
Good comments! https://chromiumcodereview.appspot.com/9271037/diff/2002/frog/leg/compiler.dart File frog/leg/compiler.dart (right): https://chromiumcodereview.appspot.com/9271037/diff/2002/frog/leg/compiler.dart#newcode80 frog/leg/compiler.dart:80: optimizer, generator, emitter, compileTimeConstantHandler]; On 2012/01/27 09:11:59, ...
8 years, 11 months ago (2012-01-27 11:39:04 UTC) #10
ahe
8 years, 11 months ago (2012-01-27 12:12:36 UTC) #11
Still LGTM :-)

A few nits.

https://chromiumcodereview.appspot.com/9271037/diff/2002/frog/leg/ssa/codegen...
File frog/leg/ssa/codegen.dart (right):

https://chromiumcodereview.appspot.com/9271037/diff/2002/frog/leg/ssa/codegen...
frog/leg/ssa/codegen.dart:557: // Character escapes that identical in meaning in
JS.
On 2012/01/27 11:39:04, Lasse Reichstein Nielsen wrote:
> Good catch.

You forgot to change it :-)

https://chromiumcodereview.appspot.com/9271037/diff/11001/frog/leg/scanner/li...
File frog/leg/scanner/listener.dart (right):

https://chromiumcodereview.appspot.com/9271037/diff/11001/frog/leg/scanner/li...
frog/leg/scanner/listener.dart:469: interpolationScope = const
EmptyLink<StringQuoting>();
FYI, you can initialize this in the field declaration.

https://chromiumcodereview.appspot.com/9271037/diff/11001/frog/leg/scanner/li...
frog/leg/scanner/listener.dart:722: // Parts of the string interpolation are
popped in reverse order,
Since all parts of the string interpolation is popped, not some of the parts, it
would be clearer if you change

"Parts of the string interpolation" to "String-interpolation parts"

Powered by Google App Engine
This is Rietveld 408576698