diff --git a/Rakefile b/Rakefile index 55c78d28..d27f7395 100644 --- a/Rakefile +++ b/Rakefile @@ -2,10 +2,10 @@ require "rubygems" require "bundler/setup" def compile_parser - system "./node_modules/jison/lib/jison/cli-wrapper.js src/handlebars.yy src/handlebars.l" + system "./node_modules/jison/lib/jison/cli-wrapper.js -m js src/handlebars.yy src/handlebars.l" if $?.success? File.open("lib/handlebars/compiler/parser.js", "w") do |file| - file.puts File.read("handlebars.js") + ";" + file.puts File.read("src/parser-prefix.js") + File.read("handlebars.js") + File.read("src/parser-suffix.js") end sh "rm handlebars.js" diff --git a/lib/handlebars/compiler/base.js b/lib/handlebars/compiler/base.js index 5ce4222e..6919d389 100644 --- a/lib/handlebars/compiler/base.js +++ b/lib/handlebars/compiler/base.js @@ -1,4 +1,4 @@ -var handlebars = require("./parser").parser; +var handlebars = require("./parser"); var Handlebars = require("../base"); // BEGIN(BROWSER) diff --git a/src/parser-prefix.js b/src/parser-prefix.js new file mode 100644 index 00000000..42345d6f --- /dev/null +++ b/src/parser-prefix.js @@ -0,0 +1 @@ +// BEGIN(BROWSER) diff --git a/src/parser-suffix.js b/src/parser-suffix.js new file mode 100644 index 00000000..fc8df139 --- /dev/null +++ b/src/parser-suffix.js @@ -0,0 +1,4 @@ + +// END(BROWSER) + +module.exports = handlebars;