slige/compiler/ast/ast.ts
2025-01-22 22:40:29 +01:00

24 lines
378 B
TypeScript

export type File = {
stmts: Stmt[];
};
export type Stmt = {
id: number;
kind: StmtKind;
};
export type StmtKind =
| { tag: "error" }
| { tag: "mod_block" } & ModBlockStmt
| { tag: "mod_file" } & ModFileStmt;
export type ModBlockStmt = {
ident: string;
stmts: Stmt[];
};
export type ModFileStmt = {
ident: string;
filePath: string;
};