diff options
author | Martin Muñoz <im.mmun@gmail.com> | 2014-11-02 14:54:54 -0500 |
---|---|---|
committer | Martin Muñoz <im.mmun@gmail.com> | 2014-11-02 18:19:20 -0500 |
commit | 12e3d210e8b3b22d19823e59bb789dc8768eb34b (patch) | |
tree | 777cf884a4ccb1791221e65e3a1cb89d552d06f2 /src | |
parent | 632fadcea39b6328983c459ff7e8c4010a976837 (diff) | |
download | handlebars.js-12e3d210e8b3b22d19823e59bb789dc8768eb34b.zip handlebars.js-12e3d210e8b3b22d19823e59bb789dc8768eb34b.tar.gz handlebars.js-12e3d210e8b3b22d19823e59bb789dc8768eb34b.tar.bz2 |
Simplify BlockNode by removing intermediate MustacheNode
Diffstat (limited to 'src')
-rw-r--r-- | src/handlebars.yy | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/handlebars.yy b/src/handlebars.yy index ccc0d22..233088b 100644 --- a/src/handlebars.yy +++ b/src/handlebars.yy @@ -17,16 +17,20 @@ statement | block -> $1 | rawBlock -> $1 | partial -> $1 - | CONTENT -> new yy.ContentNode($1, @$) + | content -> $1 | COMMENT -> new yy.CommentNode(yy.stripComment($1), yy.stripFlags($1, $1), @$) ; +content + : CONTENT -> new yy.ContentNode($1, @$) + ; + rawBlock - : openRawBlock CONTENT END_RAW_BLOCK -> new yy.RawBlockNode($1, $2, $3, @$) + : openRawBlock content END_RAW_BLOCK -> yy.prepareRawBlock($1, $2, $3, @$) ; openRawBlock - : OPEN_RAW_BLOCK sexpr CLOSE_RAW_BLOCK -> new yy.MustacheNode($2, null, '', '', @$) + : OPEN_RAW_BLOCK sexpr CLOSE_RAW_BLOCK -> { sexpr: $2 } ; block @@ -35,11 +39,11 @@ block ; openBlock - : OPEN_BLOCK sexpr CLOSE -> new yy.MustacheNode($2, null, $1, yy.stripFlags($1, $3), @$) + : OPEN_BLOCK sexpr CLOSE -> { sexpr: $2, strip: yy.stripFlags($1, $3) } ; openInverse - : OPEN_INVERSE sexpr CLOSE -> new yy.MustacheNode($2, null, $1, yy.stripFlags($1, $3), @$) + : OPEN_INVERSE sexpr CLOSE -> { sexpr: $2, strip: yy.stripFlags($1, $3) } ; inverseAndProgram |