Restructure files to make more sense in a non-CommonJS world.

This commit is contained in:
wycats
2010-11-25 02:49:08 -08:00
parent 38f8ae84fe
commit d97bc591a2
6 changed files with 59 additions and 65 deletions
+13 -16
View File
@@ -1,53 +1,50 @@
var ProgramNode = function(statements, inverse) {
if(exports) { var Handlebars = {} }
Handlebars.AST = {};
Handlebars.AST.ProgramNode = function(statements, inverse) {
this.type = "program";
this.statements = statements;
this.inverse = inverse;
};
var MustacheNode = function(params) {
Handlebars.AST.MustacheNode = function(params) {
this.type = "mustache";
this.id = params[0];
this.params = params.slice(1);
};
var PartialNode = function(id) {
Handlebars.AST.PartialNode = function(id) {
this.type = "partial";
this.id = id;
};
var BlockNode = function(mustache, program) {
Handlebars.AST.BlockNode = function(mustache, program) {
this.type = "block";
this.mustache = mustache;
this.program = program;
};
var ContentNode = function(string) {
Handlebars.AST.ContentNode = function(string) {
this.type = "content";
this.string = string;
}
var IdNode = function(id) {
Handlebars.AST.IdNode = function(id) {
this.type = "ID"
this.id = id;
}
StringNode = function(string) {
Handlebars.AST.StringNode = function(string) {
this.type = "STRING";
this.string = string;
}
CommentNode = function(comment) {
Handlebars.AST.CommentNode = function(comment) {
this.type = "comment";
this.comment = comment;
}
if(exports) {
exports.ProgramNode = ProgramNode;
exports.MustacheNode = MustacheNode;
exports.ContentNode = ContentNode;
exports.IdNode = IdNode;
exports.StringNode = StringNode;
exports.PartialNode = PartialNode;
exports.CommentNode = CommentNode;
exports.BlockNode = BlockNode;
exports.AST = Handlebars.AST;
}