| Index: frog/leg/ssa/builder.dart
|
| diff --git a/frog/leg/ssa/builder.dart b/frog/leg/ssa/builder.dart
|
| index b40cc2df2a58c5067b4d3efb6e2b1b401902ee6d..1ba1088b1bc82d5d93ad373238b4765a0e1d3fa6 100644
|
| --- a/frog/leg/ssa/builder.dart
|
| +++ b/frog/leg/ssa/builder.dart
|
| @@ -1146,7 +1146,7 @@ class SsaBuilder implements Visitor {
|
| }
|
|
|
| void visitLiteralString(LiteralString node) {
|
| - push(new HLiteral(new QuotedString.explicit(node.value), HType.STRING));
|
| + push(new HLiteral(node.quotedString, HType.STRING));
|
| }
|
|
|
| void visitLiteralNull(LiteralNull node) {
|
| @@ -1257,35 +1257,16 @@ class SsaBuilder implements Visitor {
|
| Operator op = new Operator.synthetic("+");
|
| HInstruction target = new HStatic(interceptors.getOperatorInterceptor(op));
|
| add(target);
|
| - // Ensure that string literals are marked with the correct quoting
|
| - // style and presence of quotes (left quote only on the first one,
|
| - // right quote only on the last one).
|
| - int quoteFlags = QuotedString.flagsFromLeftQuote(node.string.value);
|
| - // The loop is complicated because we have to do something extra for
|
| - // the *last* element. To do that, we handle the [string] of a part
|
| - // in the next iteration, or after the loop for the last element.
|
| - int firstPartFlags = quoteFlags | QuotedString.HAS_LEFT_QUOTE;
|
| - push(new HLiteral(new QuotedString(node.string.value, firstPartFlags),
|
| - HType.STRING));
|
| -
|
| - SourceString string = null;
|
| + visit(node.string);
|
| + // Handle the parts here, to avoid recreating [target].
|
| for (StringInterpolationPart part in node.parts) {
|
| HInstruction prefix = pop();
|
| - if (string != null) {
|
| - push(new HLiteral(new QuotedString(string, quoteFlags),
|
| - HType.STRING));
|
| - push(new HAdd(target, prefix, pop()));
|
| - prefix = pop();
|
| - }
|
| visit(part.expression);
|
| push(new HAdd(target, prefix, pop()));
|
| - string = part.string.value;
|
| + prefix = pop();
|
| + visit(part.string);
|
| + push(new HAdd(target, prefix, pop()));
|
| }
|
| - HInstruction prefix = pop();
|
| - int lastPartFlags = quoteFlags | QuotedString.HAS_RIGHT_QUOTE;
|
| - push(new HLiteral(new QuotedString(string, lastPartFlags),
|
| - HType.STRING));
|
| - push(new HAdd(target, prefix, pop()));
|
| }
|
|
|
| visitStringInterpolationPart(StringInterpolationPart node) {
|
|
|