1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#! /usr/bin/env node var fs = require("fs"); function load_global(file) { var code = fs.readFileSync(file, "utf8"); return global.eval(code); }; load_global("./utils.js"); load_global("./ast.js"); load_global("./parse.js"); /// var filename = process.argv[2]; console.time("parse"); var ast = parse(fs.readFileSync(filename, "utf8")); console.timeEnd("parse");