mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-15 00:45:04 +01:00
make it a wasi executable
This commit is contained in:
parent
8dd7c174ee
commit
1d0e3a3aff
7 changed files with 87 additions and 13 deletions
11
src/ast.ts
11
src/ast.ts
|
|
@ -1,6 +1,6 @@
|
|||
import { Span } from "./error";
|
||||
|
||||
export type Ast = Item[];
|
||||
export type Ast = { items: Item[]; typeckResults?: TypeckResults };
|
||||
|
||||
export type Identifier = {
|
||||
name: string;
|
||||
|
|
@ -273,6 +273,10 @@ export const TY_STRING: Ty = { kind: "string" };
|
|||
export const TY_BOOL: Ty = { kind: "bool" };
|
||||
export const TY_INT: Ty = { kind: "int", signed: false };
|
||||
|
||||
export type TypeckResults = {
|
||||
main: ItemId;
|
||||
};
|
||||
|
||||
// folders
|
||||
|
||||
export type FoldFn<T> = (value: T) => T;
|
||||
|
|
@ -300,7 +304,10 @@ export const DEFAULT_FOLDER: Folder = {
|
|||
};
|
||||
|
||||
export function foldAst(ast: Ast, folder: Folder): Ast {
|
||||
return ast.map((item) => folder.item(item));
|
||||
return {
|
||||
items: ast.items.map((item) => folder.item(item)),
|
||||
typeckResults: ast.typeckResults,
|
||||
};
|
||||
}
|
||||
|
||||
export function superFoldItem(item: Item, folder: Folder): Item {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue