summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/handlebars/ast.js5
-rw-r--r--lib/handlebars/compiler.js4
-rw-r--r--lib/handlebars/printer.js4
3 files changed, 13 insertions, 0 deletions
diff --git a/lib/handlebars/ast.js b/lib/handlebars/ast.js
index 86960ab..1002bd5 100644
--- a/lib/handlebars/ast.js
+++ b/lib/handlebars/ast.js
@@ -88,6 +88,11 @@ var Handlebars = require("handlebars");
this.integer = integer;
};
+ Handlebars.AST.BooleanNode = function(boolean) {
+ this.type = "BOOLEAN";
+ this.boolean = boolean;
+ };
+
Handlebars.AST.CommentNode = function(comment) {
this.type = "comment";
this.comment = comment;
diff --git a/lib/handlebars/compiler.js b/lib/handlebars/compiler.js
index d66b1db..42e5c2c 100644
--- a/lib/handlebars/compiler.js
+++ b/lib/handlebars/compiler.js
@@ -228,6 +228,10 @@ Handlebars.JavaScriptCompiler = function() {};
this.opcode('push', integer.integer);
},
+ BOOLEAN: function(boolean) {
+ this.opcode('push', boolean.boolean);
+ },
+
comment: function() {},
// HELPERS
diff --git a/lib/handlebars/printer.js b/lib/handlebars/printer.js
index 6388f01..ff3f038 100644
--- a/lib/handlebars/printer.js
+++ b/lib/handlebars/printer.js
@@ -113,6 +113,10 @@ Handlebars.PrintVisitor.prototype.INTEGER = function(integer) {
return "INTEGER{" + integer.integer + "}";
}
+Handlebars.PrintVisitor.prototype.BOOLEAN = function(boolean) {
+ return "BOOLEAN{" + boolean.boolean + "}";
+}
+
Handlebars.PrintVisitor.prototype.ID = function(id) {
var path = id.parts.join("/");
if(id.parts.length > 1) {