summaryrefslogtreecommitdiffstats
path: root/lib/handlebars
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars')
-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 1194694..86960ab 100644
--- a/lib/handlebars/ast.js
+++ b/lib/handlebars/ast.js
@@ -83,6 +83,11 @@ var Handlebars = require("handlebars");
this.string = string;
};
+ Handlebars.AST.IntegerNode = function(integer) {
+ this.type = "INTEGER";
+ this.integer = integer;
+ };
+
Handlebars.AST.CommentNode = function(comment) {
this.type = "comment";
this.comment = comment;
diff --git a/lib/handlebars/compiler.js b/lib/handlebars/compiler.js
index f3ce602..d66b1db 100644
--- a/lib/handlebars/compiler.js
+++ b/lib/handlebars/compiler.js
@@ -224,6 +224,10 @@ Handlebars.JavaScriptCompiler = function() {};
this.opcode('pushString', string.string);
},
+ INTEGER: function(integer) {
+ this.opcode('push', integer.integer);
+ },
+
comment: function() {},
// HELPERS
diff --git a/lib/handlebars/printer.js b/lib/handlebars/printer.js
index 2da7bcc..6388f01 100644
--- a/lib/handlebars/printer.js
+++ b/lib/handlebars/printer.js
@@ -109,6 +109,10 @@ Handlebars.PrintVisitor.prototype.STRING = function(string) {
return '"' + string.string + '"';
};
+Handlebars.PrintVisitor.prototype.INTEGER = function(integer) {
+ return "INTEGER{" + integer.integer + "}";
+}
+
Handlebars.PrintVisitor.prototype.ID = function(id) {
var path = id.parts.join("/");
if(id.parts.length > 1) {