diff --git a/src/ast.ts b/src/ast.ts index 52ea3e5..e918574 100644 --- a/src/ast.ts +++ b/src/ast.ts @@ -467,8 +467,8 @@ export const DEFAULT_FOLDER: Folder = { throw new Error("folders need to implement `ast`"); }, item(item) { - const newItem = this.itemInner(item); - this.ast().itemsById.set(item.id, item); + const newItem = this.itemInner(item); + this.ast().itemsById.set(item.id, newItem); return newItem; }, itemInner(item) { diff --git a/src/index.ts b/src/index.ts index 5c05fc4..f1c80f1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,15 +12,11 @@ import { exec } from "child_process"; const INPUT = ` function main() = ( - owo.uwu.main(); - owo.owo(); + prIntln(0); ); -mod owo ( - mod uwu ( - function main() =; - ); - function owo() = ; +function prIntln(x: Int) = ( + print("\n"); ); `; diff --git a/test.nil b/test.nil index 5cd32fe..1617fc6 100644 --- a/test.nil +++ b/test.nil @@ -1,8 +1,4 @@ -extern mod std; - -mod uwu; - -mod owo {} +mod owo (); function main() = ( prIntln(0);