diff options
author | kpdecker <kpdecker@gmail.com> | 2013-07-30 11:08:46 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2013-07-30 11:08:46 -0500 |
commit | 4f5c05ffe9117617b652c37e313b462b9f6f12ae (patch) | |
tree | 8f8192b895abe333a937072784ce31a68047698c | |
parent | 9ca4f9c606cf562372d1123def592f27ba1a4928 (diff) | |
download | handlebars.js-4f5c05ffe9117617b652c37e313b462b9f6f12ae.zip handlebars.js-4f5c05ffe9117617b652c37e313b462b9f6f12ae.tar.gz handlebars.js-4f5c05ffe9117617b652c37e313b462b9f6f12ae.tar.bz2 |
Simplify inverse only block case
-rw-r--r-- | dist/handlebars.js | 2 | ||||
-rw-r--r-- | spec/parser.js | 4 | ||||
-rw-r--r-- | src/handlebars.yy | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/dist/handlebars.js b/dist/handlebars.js index 4f1b1e1..e0a8368 100644 --- a/dist/handlebars.js +++ b/dist/handlebars.js @@ -205,7 +205,7 @@ case 4:this.$ = new yy.ProgramNode($$[$0-1], []); break; case 5:this.$ = new yy.ProgramNode($$[$0]); break; -case 6:this.$ = new yy.ProgramNode([], []); +case 6:this.$ = new yy.ProgramNode([]); break; case 7:this.$ = new yy.ProgramNode([]); break; diff --git a/spec/parser.js b/spec/parser.js index 06a60db..3397105 100644 --- a/spec/parser.js +++ b/spec/parser.js @@ -108,11 +108,11 @@ describe('parser', function() { }); it('parses empty blocks with empty inverse section', function() { - ast_for("{{#foo}}{{^}}{{/foo}}").should.equal("BLOCK:\n {{ ID:foo [] }}\n PROGRAM:\n {{^}}\n"); + ast_for("{{#foo}}{{^}}{{/foo}}").should.equal("BLOCK:\n {{ ID:foo [] }}\n PROGRAM:\n"); }); it('parses empty blocks with empty inverse (else-style) section', function() { - ast_for("{{#foo}}{{else}}{{/foo}}").should.equal("BLOCK:\n {{ ID:foo [] }}\n PROGRAM:\n {{^}}\n"); + ast_for("{{#foo}}{{else}}{{/foo}}").should.equal("BLOCK:\n {{ ID:foo [] }}\n PROGRAM:\n"); }); it('parses non-empty blocks with empty inverse section', function() { diff --git a/src/handlebars.yy b/src/handlebars.yy index 5764f6f..d2f24c4 100644 --- a/src/handlebars.yy +++ b/src/handlebars.yy @@ -13,7 +13,7 @@ program | statements simpleInverse statements -> new yy.ProgramNode($1, $3) | statements simpleInverse -> new yy.ProgramNode($1, []) | statements -> new yy.ProgramNode($1) - | simpleInverse -> new yy.ProgramNode([], []) + | simpleInverse -> new yy.ProgramNode([]) | "" -> new yy.ProgramNode([]) ; |