slige/compiler/ast/ast.ts

24 lines
378 B
TypeScript
Raw Normal View History

2025-01-22 21:40:29 +00:00
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;
};