Files
handlebars.js/lib/handlebars/compiler/base.js
T
kpdecker 078c1eecba Export AST as an object rather than module
The parser expects the AST object to be mutable, which modules are not.
2013-12-01 11:37:25 -06:00

13 lines
280 B
JavaScript

import parser from "./parser";
import AST from "./ast";
export { parser };
export function parse(input) {
// Just return if an already-compile AST was passed in.
if(input.constructor === AST.ProgramNode) { return input; }
parser.yy = AST;
return parser.parse(input);
}