ethers.js/packages/asm/generate.js

15 lines
373 B
JavaScript
Raw Normal View History

"use strict";
const fs = require("fs");
2020-09-23 06:18:45 +03:00
const { resolve } = require("path");
const jison = require("jison")
2020-09-23 06:18:45 +03:00
const grammar = fs.readFileSync(resolve(__dirname, "grammar.jison")).toString();
const parser = new jison.Parser(grammar);
const parserSource = parser.generate({ moduleName: "parser" });
2020-09-23 06:18:45 +03:00
fs.writeFileSync(resolve(__dirname, "./lib/_parser.js"), parserSource);