diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-05-27 14:36:51 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-05-27 14:36:51 +0300 |
commit | 22bb5e8306687fb6324f094d208b564c9e874f77 (patch) | |
tree | f04db9cd82475b8184fa34c498ffe386eb97ce6c /lib | |
parent | 46e7507b44c93cb1d9e141e583dc58600bbc037f (diff) | |
download | tracifyjs-22bb5e8306687fb6324f094d208b564c9e874f77.tar.gz tracifyjs-22bb5e8306687fb6324f094d208b564c9e874f77.zip |
added small node test script
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/node.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/node.js b/lib/node.js new file mode 100755 index 00000000..36bc18a0 --- /dev/null +++ b/lib/node.js @@ -0,0 +1,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"); + |