Boolean literals can be passed to mustaches

This commit is contained in:
Marcio Junior
2015-02-07 02:48:52 -02:00
parent fd8484798c
commit f857471cc8
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -10,6 +10,10 @@ describe('parser', function() {
}
it('parses simple mustaches', function() {
equals(ast_for('{{123}}'), "{{ NUMBER{123} [] }}\n");
equals(ast_for('{{"foo"}}'), '{{ "foo" [] }}\n');
equals(ast_for('{{false}}'), '{{ BOOLEAN{false} [] }}\n');
equals(ast_for('{{true}}'), '{{ BOOLEAN{true} [] }}\n');
equals(ast_for('{{foo}}'), "{{ PATH:foo [] }}\n");
equals(ast_for('{{foo?}}'), "{{ PATH:foo? [] }}\n");
equals(ast_for('{{foo_}}'), "{{ PATH:foo_ [] }}\n");
+1
View File
@@ -110,6 +110,7 @@ helperName
| dataName -> $1
| STRING -> new yy.StringLiteral($1, yy.locInfo(@$)), yy.locInfo(@$)
| NUMBER -> new yy.NumberLiteral($1, yy.locInfo(@$))
| BOOLEAN -> new yy.BooleanLiteral($1, yy.locInfo(@$))
;
partialName