mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-15 00:45:04 +01:00
some stuff
This commit is contained in:
parent
ef32e646d6
commit
91b183c002
11 changed files with 4320 additions and 101 deletions
33
src/ast.ts
Normal file
33
src/ast.ts
Normal 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,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue