mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-02-18 14:13:51 +00:00
add TorqueScript transpiler and runtime
This commit is contained in:
parent
c8391a1056
commit
7d10fb7dee
49 changed files with 12324 additions and 2075 deletions
13
scripts/parse-torquescript.ts
Normal file
13
scripts/parse-torquescript.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import fs from "node:fs/promises";
|
||||
import { inspect } from "node:util";
|
||||
import { parse } from "@/src/torqueScript";
|
||||
|
||||
async function run(scriptPath: string) {
|
||||
const script = await fs.readFile(scriptPath, "utf8");
|
||||
const ast = parse(script);
|
||||
|
||||
console.log(inspect(ast, { colors: true, depth: Infinity }));
|
||||
}
|
||||
|
||||
const scriptPath = process.argv[2];
|
||||
await run(scriptPath);
|
||||
Loading…
Add table
Add a link
Reference in a new issue