| Index: frog/leg/scanner/listener.dart
|
| diff --git a/frog/leg/scanner/listener.dart b/frog/leg/scanner/listener.dart
|
| index 501f753c5b8dac25f60b2f003f8a1c6c269cde99..4d6d6a5fad1ddf2697b948689f33e6da40d662d8 100644
|
| --- a/frog/leg/scanner/listener.dart
|
| +++ b/frog/leg/scanner/listener.dart
|
| @@ -170,7 +170,7 @@ class Listener {
|
| void endLiteralString(int interpolationCount) {
|
| }
|
|
|
| - void handleLiteralStringJuxtaposition(int literalCount) {
|
| + void handleStringJuxtaposition(int literalCount) {
|
| }
|
|
|
| void beginMember(Token token) {
|
| @@ -512,21 +512,27 @@ class ElementListener extends Listener {
|
|
|
| LiteralString popLiteralString() {
|
| Node node = popNode();
|
| - if (node is !LiteralString) {
|
| + if (node is !StringNode) {
|
| listener.cancel("String is not a compile time constant", node: node);
|
| return null;
|
| }
|
| + StringNode stringNode = node;
|
| + // TODO(lrn): Handle interpolations in script tags.
|
| + if (node.isInterpolation) {
|
| + listener.cancel("String is a string-interpolation", node: node);
|
| + return null;
|
| + }
|
| return node;
|
| }
|
|
|
| void endScriptTag(bool hasPrefix, Token beginToken, Token endToken) {
|
| - LiteralString prefix = null;
|
| + StringNode prefix = null;
|
| Identifier argumentName = null;
|
| if (hasPrefix) {
|
| prefix = popLiteralString();
|
| argumentName = popNode();
|
| }
|
| - LiteralString firstArgument = popLiteralString();
|
| + StringNode firstArgument = popLiteralString();
|
| Identifier tag = popNode();
|
| compilationUnitElement.addTag(new ScriptTag(tag, firstArgument,
|
| argumentName, prefix,
|
| @@ -849,14 +855,16 @@ class ElementListener extends Listener {
|
| }
|
| }
|
|
|
| - void handleLiteralStringJuxtaposition(int literalCount) {
|
| - Link<Expression> literals = const EmptyLink<Expression>();
|
| - while (literalCount > 0) {
|
| + void handleStringJuxtaposition(int stringCount) {
|
| + assert(stringCount != 0);
|
| + Expression accumulator = popNode();
|
| + stringCount -= 1;
|
| + while (stringCount > 0) {
|
| Expression expression = popNode();
|
| - literals = literals.prepend(expression);
|
| - literalCount -= 1;
|
| + accumulator = new StringJuxtaposition(expression, accumulator);
|
| + stringCount -= 1;
|
| }
|
| - pushNode(new LiteralStringJuxtaposition(literals));
|
| + pushNode(accumulator);
|
| }
|
| }
|
|
|
|
|