Inverse should really be its own node, as it has totally different runtime semantics

This commit is contained in:
wycats
2010-12-03 01:10:14 -05:00
parent 8f6f3051e6
commit c89ecf80a5
4 changed files with 31 additions and 8 deletions
+14 -1
View File
@@ -50,7 +50,7 @@ Handlebars.PrintVisitor.prototype.program = function(program) {
Handlebars.PrintVisitor.prototype.block = function(block) {
var out = "";
out = out + (block.inverted ? this.pad("INVERSE:") : this.pad("BLOCK:"));
out = out + this.pad("BLOCK:");
this.padding++;
out = out + this.accept(block.mustache);
out = out + this.accept(block.program);
@@ -59,6 +59,19 @@ Handlebars.PrintVisitor.prototype.block = function(block) {
return out;
};
Handlebars.PrintVisitor.prototype.inverse = function(block) {
var out = "";
out = out + this.pad("INVERSE:");
this.padding++;
out = out + this.accept(block.mustache);
out = out + this.accept(block.program);
this.padding--;
return out;
};
Handlebars.PrintVisitor.prototype.mustache = function(mustache) {
var params = mustache.params, paramStrings = [];