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

Issue 9642001: Make string juxtaposition combine properly with string interpolations. (Closed)

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

Description

Make string juxtaposition combine properly with string interpolations. Juxtaposed string literals combine with the first and last string parts of a string interpolation, to create a new string interpolation. Committed: https://code.google.com/p/dart/source/detail?r=5674

Patch Set 1 #

Total comments: 9

Patch Set 2 : Addressed review comments. #

Total comments: 4

Patch Set 3 : Change structure, moving complexity to builder. #

Patch Set 4 : Remove last bugs and clean up builder. #

Total comments: 14

Patch Set 5 : Address comments. #

Total comments: 8

Patch Set 6 : Merge to tip of tree #

Patch Set 7 : Refactor juxtaposition handling. #

Total comments: 2

Patch Set 8 : merge to tip of tree #

Patch Set 9 : Fix typo #

Total comments: 14

Patch Set 10 : Addressed comments so far. #

Total comments: 28

Patch Set 11 : Addressed review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+328 lines, -265 lines) Patch
M frog/leg/compile_time_constants.dart View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -1 line 0 comments Download
M frog/leg/resolver.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -0 lines 0 comments Download
M frog/leg/scanner/listener.dart View 1 2 3 4 5 6 7 8 9 10 3 chunks +16 lines, -12 lines 0 comments Download
M frog/leg/scanner/parser.dart View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M frog/leg/scanner/scanner_task.dart View 1 2 3 4 5 6 7 8 9 10 3 chunks +8 lines, -5 lines 0 comments Download
M frog/leg/ssa/builder.dart View 1 2 3 4 5 6 7 8 9 10 5 chunks +121 lines, -17 lines 0 comments Download
M frog/leg/ssa/codegen.dart View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M frog/leg/ssa/nodes.dart View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M frog/leg/tree/nodes.dart View 1 2 3 4 5 6 7 8 9 10 10 chunks +99 lines, -212 lines 0 comments Download
M frog/leg/tree/tree.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M frog/leg/tree/unparser.dart View 1 2 3 4 5 6 7 1 chunk +4 lines, -9 lines 0 comments Download
M frog/leg/tree/visitors.dart View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -5 lines 0 comments Download
M frog/leg/typechecker.dart View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
M frog/tests/leg_only/src/LiteralStringJuxtapositionTest.dart View 1 2 3 1 chunk +54 lines, -0 lines 0 comments Download
M tests/language/language-leg.status View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Lasse Reichstein Nielsen
8 years, 9 months ago (2012-03-08 07:15:42 UTC) #1
ngeoffray
LGTM, but I would wait for Peter feedback before submitting. https://chromiumcodereview.appspot.com/9642001/diff/1/frog/leg/scanner/listener.dart File frog/leg/scanner/listener.dart (right): https://chromiumcodereview.appspot.com/9642001/diff/1/frog/leg/scanner/listener.dart#newcode872 ...
8 years, 9 months ago (2012-03-08 10:37:08 UTC) #2
Lasse Reichstein Nielsen
https://chromiumcodereview.appspot.com/9642001/diff/1/frog/leg/scanner/listener.dart File frog/leg/scanner/listener.dart (right): https://chromiumcodereview.appspot.com/9642001/diff/1/frog/leg/scanner/listener.dart#newcode872 frog/leg/scanner/listener.dart:872: if (expression is StringInterpolation) { As discussed offline, I'll ...
8 years, 9 months ago (2012-03-08 11:17:49 UTC) #3
ngeoffray
https://chromiumcodereview.appspot.com/9642001/diff/1/frog/leg/tree/nodes.dart File frog/leg/tree/nodes.dart (right): https://chromiumcodereview.appspot.com/9642001/diff/1/frog/leg/tree/nodes.dart#newcode734 frog/leg/tree/nodes.dart:734: DartString(); On 2012/03/08 11:17:49, Lasse Reichstein Nielsen wrote: > ...
8 years, 9 months ago (2012-03-08 11:21:21 UTC) #4
Lasse Reichstein Nielsen
Any comments, Peter?
8 years, 9 months ago (2012-03-08 14:55:03 UTC) #5
ahe
Hi Lasse, Before we move further on this, I would like to discuss the design ...
8 years, 9 months ago (2012-03-12 09:31:03 UTC) #6
Lasse Reichstein Nielsen
PTAL.
8 years, 9 months ago (2012-03-14 11:40:09 UTC) #7
ngeoffray
LGTM, with comments http://codereview.chromium.org/9642001/diff/14001/frog/leg/compile_time_constants.dart File frog/leg/compile_time_constants.dart (right): http://codereview.chromium.org/9642001/diff/14001/frog/leg/compile_time_constants.dart#newcode772 frog/leg/compile_time_constants.dart:772: if (node.dartString !== null) { Replace ...
8 years, 9 months ago (2012-03-14 12:29:58 UTC) #8
Lasse Reichstein Nielsen
http://codereview.chromium.org/9642001/diff/14001/frog/leg/compile_time_constants.dart File frog/leg/compile_time_constants.dart (right): http://codereview.chromium.org/9642001/diff/14001/frog/leg/compile_time_constants.dart#newcode772 frog/leg/compile_time_constants.dart:772: if (node.dartString !== null) { True. I'm still not ...
8 years, 9 months ago (2012-03-14 13:04:48 UTC) #9
ahe
I expected to see a change to this line in scanner_task: SourceString argument = tag.argument.value.copyWithoutQuotes(1, ...
8 years, 9 months ago (2012-03-15 09:02:56 UTC) #10
Lasse Reichstein Nielsen
Now also adds juxtaposition support to scanner_task. I gave all the string-nodes a common interface ...
8 years, 9 months ago (2012-03-19 07:15:32 UTC) #11
ahe
Initial comments. https://chromiumcodereview.appspot.com/9642001/diff/19001/frog/leg/tree/nodes.dart File frog/leg/tree/nodes.dart (right): https://chromiumcodereview.appspot.com/9642001/diff/19001/frog/leg/tree/nodes.dart#newcode736 frog/leg/tree/nodes.dart:736: interface StringNode /* extends Node - when ...
8 years, 9 months ago (2012-03-19 08:13:08 UTC) #12
Lasse Reichstein Nielsen
https://chromiumcodereview.appspot.com/9642001/diff/19001/frog/leg/tree/nodes.dart File frog/leg/tree/nodes.dart (right): https://chromiumcodereview.appspot.com/9642001/diff/19001/frog/leg/tree/nodes.dart#newcode736 frog/leg/tree/nodes.dart:736: interface StringNode /* extends Node - when supported */ ...
8 years, 9 months ago (2012-03-19 09:57:47 UTC) #13
Lasse Reichstein Nielsen
Made StringNode a proper subclass of Expression, and it Just Worked (TM). PTAnotherL.
8 years, 9 months ago (2012-03-19 12:10:11 UTC) #14
ahe
Liking you changes to tree/nodes.dart. More comments will follow. https://chromiumcodereview.appspot.com/9642001/diff/20018/frog/leg/tree/nodes.dart File frog/leg/tree/nodes.dart (right): https://chromiumcodereview.appspot.com/9642001/diff/20018/frog/leg/tree/nodes.dart#newcode1138 frog/leg/tree/nodes.dart:1138: ...
8 years, 9 months ago (2012-03-19 14:44:20 UTC) #15
Lasse Reichstein Nielsen
https://chromiumcodereview.appspot.com/9642001/diff/20018/frog/leg/tree/nodes.dart File frog/leg/tree/nodes.dart (right): https://chromiumcodereview.appspot.com/9642001/diff/20018/frog/leg/tree/nodes.dart#newcode1138 frog/leg/tree/nodes.dart:1138: // Caches the check for whether this juxtaposition contains ...
8 years, 9 months ago (2012-03-19 15:07:33 UTC) #16
ahe
LGTM!!! Thanks for being tenacious! Cheers, Peter https://chromiumcodereview.appspot.com/9642001/diff/20018/frog/leg/compile_time_constants.dart File frog/leg/compile_time_constants.dart (right): https://chromiumcodereview.appspot.com/9642001/diff/20018/frog/leg/compile_time_constants.dart#newcode776 frog/leg/compile_time_constants.dart:776: return super.visitStringJuxtaposition(node); ...
8 years, 9 months ago (2012-03-19 15:53:05 UTC) #17
Lasse Reichstein Nielsen
https://chromiumcodereview.appspot.com/9642001/diff/20018/frog/leg/compile_time_constants.dart File frog/leg/compile_time_constants.dart (right): https://chromiumcodereview.appspot.com/9642001/diff/20018/frog/leg/compile_time_constants.dart#newcode776 frog/leg/compile_time_constants.dart:776: return super.visitStringJuxtaposition(node); This is just a temporary stopgap. I ...
8 years, 9 months ago (2012-03-20 09:34:33 UTC) #18
ahe
8 years, 9 months ago (2012-03-20 10:23:01 UTC) #19
FYI

https://chromiumcodereview.appspot.com/9642001/diff/22016/frog/leg/scanner/sc...
File frog/leg/scanner/scanner_task.dart (right):

https://chromiumcodereview.appspot.com/9642001/diff/22016/frog/leg/scanner/sc...
frog/leg/scanner/scanner_task.dart:110: new
SourceString(tag.prefix.dartString.slowToString());
On 2012/03/20 09:34:33, Lasse Reichstein Nielsen wrote:
> We do have that (dartString.source), but it includes uninterpreted escapes. Is
> this what we need here?

Perhaps. I'm not sure what the specification says, but allowing escapes here
doesn't seem right.

> Or, if you want quotes too, just use tag.prefix.value.

I definitely don't want the quotes.

> Personally, I'd just make PrefixElement hold either a StringNode or a
DartString
> instead of a SourceString. It's an element, so I think DartString would be
> appropriate.

I don't see how that would work. The prefix element needs to go into a scope
that is based on SourceStrings. It is a kind of weird identifier.

Powered by Google App Engine
This is Rietveld 408576698