summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/base.js
blob: d6cb06ee2c55f3ba23c999a76b06c2ee6d58fc21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import parser from "./parser";
module 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);
}