slige/compiler/mod.ts

15 lines
430 B
TypeScript
Raw Normal View History

2024-11-21 11:08:07 +00:00
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();
}