var Handlebars = {}; Handlebars.Visitor = require("handlebars/visitor").Visitor; // BEGIN(BROWSER) Handlebars.PrintVisitor = function() { this.padding = 0; }; Handlebars.PrintVisitor.prototype = new Handlebars.Visitor(); Handlebars.PrintVisitor.prototype.pad = function(string, newline) { var out = ""; for(var i=0,l=this.padding; i " + content + " }}"); }; Handlebars.PrintVisitor.prototype.STRING = function(string) { return '"' + string.string + '"'; }; Handlebars.PrintVisitor.prototype.ID = function(id) { var path = id.parts.join("/"); if(id.parts.length > 1) { return "PATH:" + path; } else { return "ID:" + path; } }; Handlebars.PrintVisitor.prototype.content = function(content) { return this.pad("CONTENT[ '" + content.string + "' ]"); }; Handlebars.PrintVisitor.prototype.comment = function(comment) { return this.pad("{{! '" + comment.comment + "' }}"); }; // END(BROWSER) exports.PrintVisitor = Handlebars.PrintVisitor;