| const fs = require("fs"); | |
| const path = require("path"); | |
| const { run } = require("./mini_lang"); | |
| function main() { | |
| const filePath = process.argv[2] || path.join(__dirname, "example.mini"); | |
| const source = fs.readFileSync(filePath, "utf8"); | |
| console.log("运行自定义语言程序,源文件:", filePath); | |
| run(source); | |
| } | |
| main(); | |