Restructure files to make more sense in a non-CommonJS world.
This commit is contained in:
+13
-16
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user