nix-in-node/testers/transform.js
2022-02-02 10:39:55 +01:00

15 lines
427 B
JavaScript

"use strict";
const fs = require("fs");
const assert = require("assert");
const parse = require("../src/parse");
const astformer = require("../src/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"));
let transformed = astformer(tree, transformers);
printAST(transformed);