diff options
author | Martin Muñoz <im.mmun@gmail.com> | 2014-11-11 21:35:10 -0500 |
---|---|---|
committer | Martin Muñoz <im.mmun@gmail.com> | 2014-11-11 21:35:10 -0500 |
commit | b8a9f7264d3b6ac48514272bf35291736cedad00 (patch) | |
tree | 08fdbc4c7e73e63f98a136285cc7a9958bec719f /spec/tokenizer.js | |
parent | b3b5b358895566c04b3a9776ac81c5bcf245e27c (diff) | |
download | handlebars.js-b8a9f7264d3b6ac48514272bf35291736cedad00.zip handlebars.js-b8a9f7264d3b6ac48514272bf35291736cedad00.tar.gz handlebars.js-b8a9f7264d3b6ac48514272bf35291736cedad00.tar.bz2 |
Add parser support for block params
Diffstat (limited to 'spec/tokenizer.js')
-rw-r--r-- | spec/tokenizer.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/tokenizer.js b/spec/tokenizer.js index 6f5cc38..93ed97c 100644 --- a/spec/tokenizer.js +++ b/spec/tokenizer.js @@ -399,4 +399,18 @@ describe('Tokenizer', function() { var result = tokenize("{{foo (bar (lol true) false) (baz 1) (blah 'b') (blorg \"c\")}}"); shouldMatchTokens(result, ['OPEN', 'ID', 'OPEN_SEXPR', 'ID', 'OPEN_SEXPR', 'ID', 'BOOLEAN', 'CLOSE_SEXPR', 'BOOLEAN', 'CLOSE_SEXPR', 'OPEN_SEXPR', 'ID', 'NUMBER', 'CLOSE_SEXPR', 'OPEN_SEXPR', 'ID', 'STRING', 'CLOSE_SEXPR', 'OPEN_SEXPR', 'ID', 'STRING', 'CLOSE_SEXPR', 'CLOSE']); }); + + it('tokenizes block params', function() { + var result = tokenize("{{#foo as |bar|}}"); + shouldMatchTokens(result, ['OPEN_BLOCK', 'ID', 'OPEN_BLOCK_PARAMS', 'ID', 'CLOSE_BLOCK_PARAMS', 'CLOSE']); + + var result = tokenize("{{#foo as |bar baz|}}"); + shouldMatchTokens(result, ['OPEN_BLOCK', 'ID', 'OPEN_BLOCK_PARAMS', 'ID', 'ID', 'CLOSE_BLOCK_PARAMS', 'CLOSE']); + + var result = tokenize("{{#foo as | bar baz |}}"); + shouldMatchTokens(result, ['OPEN_BLOCK', 'ID', 'OPEN_BLOCK_PARAMS', 'ID', 'ID', 'CLOSE_BLOCK_PARAMS', 'CLOSE']); + + var result = tokenize("{{#foo as as | bar baz |}}"); + shouldMatchTokens(result, ['OPEN_BLOCK', 'ID', 'ID', 'OPEN_BLOCK_PARAMS', 'ID', 'ID', 'CLOSE_BLOCK_PARAMS', 'CLOSE']); + }); }); |