aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-05-27 14:36:51 +0300
committerMihai Bazon <mihai@bazon.net>2012-05-27 14:36:51 +0300
commit22bb5e8306687fb6324f094d208b564c9e874f77 (patch)
treef04db9cd82475b8184fa34c498ffe386eb97ce6c /lib
parent46e7507b44c93cb1d9e141e583dc58600bbc037f (diff)
downloadtracifyjs-22bb5e8306687fb6324f094d208b564c9e874f77.tar.gz
tracifyjs-22bb5e8306687fb6324f094d208b564c9e874f77.zip
added small node test script
Diffstat (limited to 'lib')
-rwxr-xr-xlib/node.js20
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");
+