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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2753523002: VM: [KERNEL] handle single-argument string interpolation in VM (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/kernel_to_il.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 65f324a8ba4f63c6f4176187e1f10a29838bc4ec..f2d9421a25c9110c8c591da0744d723083a42717 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -818,18 +818,26 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
Token last = parts.last;
Quote quote = analyzeQuote(first.lexeme);
List<Expression> expressions = <Expression>[];
- expressions
+ // Contains more then just \' or \".
ahe 2017/03/14 14:58:44 than.
+ if (first.lexeme.length > 1) {
+ expressions
.add(new StringLiteral(unescapeFirstStringPart(first.lexeme, quote)));
+ }
for (int i = 1; i < parts.length - 1; i++) {
var part = parts[i];
if (part is Token) {
- expressions.add(new StringLiteral(unescape(part.lexeme, quote)));
+ if (part.lexeme.length != 0) {
+ expressions.add(new StringLiteral(unescape(part.lexeme, quote)));
+ }
} else {
expressions.add(toValue(part));
}
}
- expressions
+ // Contains more then just \' or \".
ahe 2017/03/14 14:58:44 Than.
+ if (last.lexeme.length > 1) {
+ expressions
.add(new StringLiteral(unescapeLastStringPart(last.lexeme, quote)));
+ }
push(new StringConcatenation(expressions)
..fileOffset = endToken.charOffset);
}
« no previous file with comments | « no previous file | runtime/vm/kernel_to_il.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698