Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improved literal text and prefix modifier tokenization

  • Loading branch information...
commit 2f176d680b31163d304c0abb9c93b1e13ba1f049 1 parent 002b57f
@brettstimmerman authored
Showing with 13 additions and 2 deletions.
  1. +2 −2 src/temple.l
  2. +11 −0 test/temple-test.js
View
4 src/temple.l
@@ -1,6 +1,6 @@
-LITERAL [^{]+
+LITERAL [^{}]+
OPERATOR [\?\/\.;&#+]
-PREFIX \:\d+
+PREFIX \:[1-9](?:[0-9]{1,3})?
VARIABLE [a-zA-Z0-9_]+
%s expression
View
11 test/temple-test.js
@@ -286,8 +286,19 @@ describe('Temple', function () {
var tests = [
'{{}',
'}',
+ '{',
+ 'x{',
+ 'list}',
+
'{x*y}',
'{list*y}',
+
+ '{who,}',
+ '{,who}',
+ '{who:}',
+ '{who:0}',
+ '{who:12345}',
+
'{&bool_keys:3*}',
'{&bool_keys*:3}'
];
Please sign in to comment.
Something went wrong with that request. Please try again.