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

Issue 10539021: Scanner can include comments in the token stream. (Closed)

Created:
8 years, 6 months ago by Johnni Winther
Modified:
8 years, 6 months ago
Reviewers:
ahe, Anton Muhin
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Scanner can include comments in the token stream. includeComments option argument added to the ByteArrayScanner. default is false. Test of charOffset, charLength invariants on scanner output added. Calls to beginToken() moved to fix invalid Token.charOffset values for string interpolations. BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=9059

Patch Set 1 #

Total comments: 2

Patch Set 2 : Merged #

Patch Set 3 : Nested comments bug fixed #

Total comments: 27

Patch Set 4 : String interpolation identifier used new token #

Total comments: 1

Patch Set 5 : General string interpolation also uses kind test #

Total comments: 19

Patch Set 6 : Token.text replaced by Token.slowToString() #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -16 lines) Patch
M lib/compiler/implementation/scanner/array_based_scanner.dart View 1 2 chunks +8 lines, -1 line 0 comments Download
M lib/compiler/implementation/scanner/byte_array_scanner.dart View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M lib/compiler/implementation/scanner/parser.dart View 1 2 3 4 5 2 chunks +24 lines, -5 lines 1 comment Download
M lib/compiler/implementation/scanner/scanner.dart View 1 2 3 4 5 6 chunks +53 lines, -7 lines 0 comments Download
M lib/compiler/implementation/scanner/string_scanner.dart View 1 chunk +2 lines, -1 line 0 comments Download
M lib/compiler/implementation/scanner/token.dart View 1 2 3 4 5 4 chunks +54 lines, -1 line 0 comments Download
A tests/compiler/dart2js/scanner_offset_length_test.dart View 1 2 3 4 5 1 chunk +47 lines, -0 lines 1 comment Download

Messages

Total messages: 13 (0 generated)
Johnni Winther
8 years, 6 months ago (2012-06-06 11:45:22 UTC) #1
Anton Muhin
DBC If I correctly understand what goes on here, it may break http://code.google.com/p/dart/source/detail?r=8314 something like ...
8 years, 6 months ago (2012-06-06 16:18:35 UTC) #2
Johnni Winther
http://codereview.chromium.org/10539021/diff/1/lib/compiler/implementation/scanner/scanner.dart File lib/compiler/implementation/scanner/scanner.dart (right): http://codereview.chromium.org/10539021/diff/1/lib/compiler/implementation/scanner/scanner.dart#newcode715 lib/compiler/implementation/scanner/scanner.dart:715: appendBeginGroup(STRING_INTERPOLATION_INFO, "\$"); There seems to be a problem with ...
8 years, 6 months ago (2012-06-07 08:22:16 UTC) #3
Johnni Winther
Inclusion of comments is optional and off by default so operator /**/ [] generates the ...
8 years, 6 months ago (2012-06-07 08:29:56 UTC) #4
ahe
I think we need to find a different approach to Anton's fix. Anton, do you ...
8 years, 6 months ago (2012-06-15 13:34:28 UTC) #5
Johnni Winther
A new patch has been uploaded.
8 years, 6 months ago (2012-06-21 13:33:42 UTC) #6
ahe
Definitely a step in the right direction, but I have a whole bunch of style ...
8 years, 6 months ago (2012-06-22 08:42:49 UTC) #7
Johnni Winther
http://codereview.chromium.org/10539021/diff/10002/lib/compiler/implementation/scanner/scanner.dart File lib/compiler/implementation/scanner/scanner.dart (right): http://codereview.chromium.org/10539021/diff/10002/lib/compiler/implementation/scanner/scanner.dart#newcode574 lib/compiler/implementation/scanner/scanner.dart:574: if ($LF === next || $CR === next || ...
8 years, 6 months ago (2012-06-22 09:55:52 UTC) #8
Johnni Winther
String interpolation of identifiers now uses a new token as marker. http://codereview.chromium.org/10539021/diff/10002/lib/compiler/implementation/scanner/parser.dart File lib/compiler/implementation/scanner/parser.dart (right): ...
8 years, 6 months ago (2012-06-22 10:23:10 UTC) #9
Johnni Winther
Parsing of general string interpolation now also uses token.kind test instead of optional(...).
8 years, 6 months ago (2012-06-22 11:43:11 UTC) #10
ahe
I understand the scanner changes, and they look good. I'm concerned about wrapping slowToString in ...
8 years, 6 months ago (2012-06-25 08:12:37 UTC) #11
Johnni Winther
PTAL http://codereview.chromium.org/10539021/diff/8016/lib/compiler/implementation/scanner/parser.dart File lib/compiler/implementation/scanner/parser.dart (right): http://codereview.chromium.org/10539021/diff/8016/lib/compiler/implementation/scanner/parser.dart#newcode1289 lib/compiler/implementation/scanner/parser.dart:1289: var tokenKind = token.kind; On 2012/06/25 08:12:37, ahe ...
8 years, 6 months ago (2012-06-25 10:40:00 UTC) #12
ahe
8 years, 6 months ago (2012-06-25 10:55:52 UTC) #13
LGTM!

http://codereview.chromium.org/10539021/diff/22002/lib/compiler/implementatio...
File lib/compiler/implementation/scanner/parser.dart (right):

http://codereview.chromium.org/10539021/diff/22002/lib/compiler/implementatio...
lib/compiler/implementation/scanner/parser.dart:1308: // Parsing the
infix/suffix, for instance y and z' of 'x${id}y${id}z'
Very nice.

http://codereview.chromium.org/10539021/diff/22002/tests/compiler/dart2js/sca...
File tests/compiler/dart2js/scanner_offset_length_test.dart (right):

http://codereview.chromium.org/10539021/diff/22002/tests/compiler/dart2js/sca...
tests/compiler/dart2js/scanner_offset_length_test.dart:39: check('foo'); //
identifier
Comments still aren't proper sentences.

Powered by Google App Engine
This is Rietveld 408576698