From 903fe75747df0cdf0e34be1d46b70fc5fa849c69 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Mon, 31 Jul 2023 15:13:45 +0200 Subject: [PATCH] fix folder --- src/ast.ts | 4 ++-- src/index.ts | 10 +++------- test.nil | 6 +----- 3 files changed, 6 insertions(+), 14 deletions(-) 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);