slige/compiler/mod.ts
2024-12-10 21:42:15 +01:00

15 lines
430 B
TypeScript

import { Stmt } from "./ast.ts";
import { Lexer } from "./lexer.ts";
import { Parser } from "./parser.ts";
export * from "./parser.ts";
export * from "./ast.ts";
export * from "./arch.ts";
export * from "./lexer.ts";
export * from "./token.ts";
export async function compileWithDebug(filepath: string): Promise<Stmt[]> {
const text = await Deno.readTextFile(filepath);
return new Parser(new Lexer(text)).parseStmts();
}