some stuff

This commit is contained in:
nora 2023-07-23 11:51:59 +02:00
parent ef32e646d6
commit 91b183c002
11 changed files with 4320 additions and 101 deletions

33
src/ast.ts Normal file
View file

@ -0,0 +1,33 @@
import { Span } from "./error";
export type ItemKind = {
kind: "function",
node: FunctionDef,
};
export type Item = ItemKind & {
span: Span,
}
export type FunctionDef = {
name: string,
args: FunctionArg[],
body: Expr,
}
export type FunctionArg = {
name: string,
span: Span,
}
export type ExprKind = {
kind: "lit_string",
value: string,
} | {
kind: "ident",
value: string,
}
export type Expr = ExprKind & {
span: Span,
}