21 lines
537 B
JavaScript
21 lines
537 B
JavaScript
"use strict";
|
|
|
|
const fs = require("fs");
|
|
const assert = require("assert");
|
|
|
|
const parse = require("../src/parse");
|
|
const astformer = require("astformer");
|
|
const transformers = require("../src/transformers");
|
|
const printAST = require("../src/print-ast");
|
|
|
|
assert(process.argv[2] != null);
|
|
let tree = parse(fs.readFileSync(process.argv[2], "utf8"));
|
|
|
|
// for (let i = 0; i < 10000; i++) {
|
|
// astformer(tree, transformers);
|
|
// }
|
|
|
|
let transformed = astformer(tree, transformers);
|
|
printAST(transformed.ast);
|
|
console.log(transformed.timings);
|