diff options
Diffstat (limited to 'lib/handlebars/compiler/printer.js')
-rw-r--r-- | lib/handlebars/compiler/printer.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/handlebars/compiler/printer.js b/lib/handlebars/compiler/printer.js index f91ff02..ad55c7d 100644 --- a/lib/handlebars/compiler/printer.js +++ b/lib/handlebars/compiler/printer.js @@ -62,8 +62,8 @@ PrintVisitor.prototype.block = function(block) { return out; }; -PrintVisitor.prototype.mustache = function(mustache) { - var params = mustache.params, paramStrings = [], hash; +PrintVisitor.prototype.sexpr = function(sexpr) { + var params = sexpr.params, paramStrings = [], hash; for(var i=0, l=params.length; i<l; i++) { paramStrings.push(this.accept(params[i])); @@ -71,9 +71,13 @@ PrintVisitor.prototype.mustache = function(mustache) { params = "[" + paramStrings.join(", ") + "]"; - hash = mustache.hash ? " " + this.accept(mustache.hash) : ""; + hash = sexpr.hash ? " " + this.accept(sexpr.hash) : ""; + + return this.accept(sexpr.id) + " " + params + hash; +}; - return this.pad("{{ " + this.accept(mustache.id) + " " + params + hash + " }}"); +PrintVisitor.prototype.mustache = function(mustache) { + return this.pad("{{ " + this.accept(mustache.sexpr) + " }}"); }; PrintVisitor.prototype.partial = function(partial) { |