25 lines
516 B
JavaScript
25 lines
516 B
JavaScript
"use strict";
|
|
|
|
const fs = require("fs");
|
|
const assert = require("assert");
|
|
|
|
const transpile = require("./src/transpile");
|
|
|
|
assert(process.argv[2] != null);
|
|
|
|
const nixFilePath = process.argv[2];
|
|
const nixFile = fs.readFileSync(nixFilePath, "utf8");
|
|
|
|
let transpiled = transpile(nixFile);
|
|
|
|
console.log("-- EVALUATION RESULT:");
|
|
|
|
console.log(eval(transpiled)({
|
|
builtins: {},
|
|
$$jsNix$extend: function (base, props) {
|
|
let newObject = Object.create(base);
|
|
Object.assign(newObject, props);
|
|
return newObject;
|
|
}
|
|
}));
|