Lua: add AST pretty-printer and align parse/print naming

This commit is contained in:
Zef Hemel
2026-05-31 13:50:31 +02:00
parent e87c4e2e26
commit a4f738815f
24 changed files with 943 additions and 128 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
import { expect, test } from "vitest";
import { parse } from "./parse.ts";
import { parseBlock } from "./parse.ts";
import { evalStatement } from "./eval.ts";
import { LuaEnv, LuaRuntimeError, LuaStackFrame } from "./runtime.ts";
import { luaBuildStandardEnv } from "./stdlib.ts";
async function runAndCatch(code: string, ref = "ctx_test.lua") {
const ast = parse(code, { ref });
const ast = parseBlock(code, { ref });
const global = luaBuildStandardEnv();
const env = new LuaEnv(global);
const sf = LuaStackFrame.createWithGlobalEnv(global, ast.ctx);