aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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");
+