Create compiler base file.
This commit is contained in:
@@ -28,7 +28,7 @@ def remove_exports(string)
|
|||||||
match ? match[1] : string
|
match ? match[1] : string
|
||||||
end
|
end
|
||||||
|
|
||||||
minimal_deps = %w(compiler/parser base compiler/ast utils compiler/compiler vm).map do |file|
|
minimal_deps = %w(base compiler/parser compiler/base compiler/ast utils compiler/compiler vm).map do |file|
|
||||||
"lib/handlebars/#{file}.js"
|
"lib/handlebars/#{file}.js"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,8 @@
|
|||||||
var handlebars = require("handlebars/compiler/parser").parser;
|
|
||||||
|
|
||||||
// BEGIN(BROWSER)
|
// BEGIN(BROWSER)
|
||||||
var Handlebars = {};
|
var Handlebars = {};
|
||||||
|
|
||||||
Handlebars.VERSION = "1.0.beta.2";
|
Handlebars.VERSION = "1.0.beta.2";
|
||||||
|
|
||||||
Handlebars.Parser = handlebars;
|
|
||||||
|
|
||||||
Handlebars.parse = function(string) {
|
|
||||||
Handlebars.Parser.yy = Handlebars.AST;
|
|
||||||
return Handlebars.Parser.parse(string);
|
|
||||||
};
|
|
||||||
|
|
||||||
Handlebars.print = function(ast) {
|
|
||||||
return new Handlebars.PrintVisitor().accept(ast);
|
|
||||||
};
|
|
||||||
|
|
||||||
Handlebars.helpers = {};
|
Handlebars.helpers = {};
|
||||||
Handlebars.partials = {};
|
Handlebars.partials = {};
|
||||||
|
|
||||||
@@ -99,15 +86,6 @@ Handlebars.registerHelper('with', function(context, options) {
|
|||||||
return options.fn(context);
|
return options.fn(context);
|
||||||
});
|
});
|
||||||
|
|
||||||
Handlebars.logger = {
|
|
||||||
DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
|
|
||||||
|
|
||||||
// override in the host environment
|
|
||||||
log: function(level, str) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };
|
|
||||||
|
|
||||||
// END(BROWSER)
|
// END(BROWSER)
|
||||||
|
|
||||||
module.exports = Handlebars;
|
module.exports = Handlebars;
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
var handlebars = require("handlebars/compiler/parser").parser;
|
||||||
|
var Handlebars = require("../base");
|
||||||
|
|
||||||
|
// BEGIN(BROWSER)
|
||||||
|
var Handlebars = Handlebars || {};
|
||||||
|
|
||||||
|
Handlebars.Parser = handlebars;
|
||||||
|
|
||||||
|
Handlebars.parse = function(string) {
|
||||||
|
Handlebars.Parser.yy = Handlebars.AST;
|
||||||
|
return Handlebars.Parser.parse(string);
|
||||||
|
};
|
||||||
|
|
||||||
|
Handlebars.print = function(ast) {
|
||||||
|
return new Handlebars.PrintVisitor().accept(ast);
|
||||||
|
};
|
||||||
|
|
||||||
|
Handlebars.logger = {
|
||||||
|
DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
|
||||||
|
|
||||||
|
// override in the host environment
|
||||||
|
log: function(level, str) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };
|
||||||
|
|
||||||
|
// END(BROWSER)
|
||||||
|
|
||||||
|
module.exports = Handlebars;
|
||||||
+2
-1
@@ -72,8 +72,9 @@ module Handlebars
|
|||||||
puts
|
puts
|
||||||
end
|
end
|
||||||
|
|
||||||
Handlebars::Spec.js_load('lib/handlebars/compiler/parser.js')
|
|
||||||
Handlebars::Spec.js_load('lib/handlebars/base.js');
|
Handlebars::Spec.js_load('lib/handlebars/base.js');
|
||||||
|
Handlebars::Spec.js_load('lib/handlebars/compiler/parser.js')
|
||||||
|
Handlebars::Spec.js_load('lib/handlebars/compiler/base.js');
|
||||||
Handlebars::Spec.js_load('lib/handlebars/compiler/ast.js');
|
Handlebars::Spec.js_load('lib/handlebars/compiler/ast.js');
|
||||||
Handlebars::Spec.js_load('lib/handlebars/compiler/visitor.js');
|
Handlebars::Spec.js_load('lib/handlebars/compiler/visitor.js');
|
||||||
Handlebars::Spec.js_load('lib/handlebars/compiler/printer.js')
|
Handlebars::Spec.js_load('lib/handlebars/compiler/printer.js')
|
||||||
|
|||||||
Reference in New Issue
Block a user