From e94e55f6426d2af55ed4ae9444d1d7f23b16010f Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Fri, 10 Jun 2016 22:55:47 -0700 Subject: [PATCH] Support static strings. --- lib/src/parser.dart | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/src/parser.dart b/lib/src/parser.dart index c336445b..7f05026a 100644 --- a/lib/src/parser.dart +++ b/lib/src/parser.dart @@ -466,7 +466,7 @@ class Parser { return new VariableExpression(name, span: _scanner.spanFrom(start)); } - StringExpression _string() { + StringExpression _string({bool static: false}) { var start = _scanner.state; var quote = _scanner.readChar(); @@ -489,7 +489,7 @@ class Parser { } else { buffer.writeCharCode(_escape()); } - } else if (next == $hash) { + } else if (next == $hash && !static) { if (_scanner.peekChar(1) == $lbrace) { buffer.add(_singleInterpolation()); } else { @@ -785,7 +785,7 @@ class Parser { var next = _scanner.peekChar(); var value = next == $single_quote || next == $double_quote - ? _staticString() + ? _string(static: true) : _identifier(); _ignoreComments(); @@ -1061,8 +1061,6 @@ class Parser { // ## Tokens - String _staticString() => throw new UnimplementedError(); - String _commentText() => _rawText(_ignoreComments); bool _scanWhitespace() {