From 4f572150bfa9ab6309b80b7f8121f4c6c73f0f1e Mon Sep 17 00:00:00 2001 From: Vardan2009 <70532109+Vardan2009@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:26:15 +0400 Subject: [PATCH] Some more stuff fixed --- eiger/Execution/BuiltInTypes/Array.cs | 1 + eiger/Execution/Interpreter.cs | 3 ++- eiger/stdlibs/event.ei | 2 +- eiger/stdlibs/iterator.ei | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/eiger/Execution/BuiltInTypes/Array.cs b/eiger/Execution/BuiltInTypes/Array.cs index 003c4ba..2ed0c00 100644 --- a/eiger/Execution/BuiltInTypes/Array.cs +++ b/eiger/Execution/BuiltInTypes/Array.cs @@ -75,6 +75,7 @@ public override void SetIndex(int idx, Value val) { if (idx < 0 || idx >= array.Length) throw new EigerError(filename, line, pos, "Index outside of bounds", EigerError.ErrorType.IndexError); + val.modifiers = array[idx].modifiers; array[idx] = val; } diff --git a/eiger/Execution/Interpreter.cs b/eiger/Execution/Interpreter.cs index 521c021..c3465f9 100644 --- a/eiger/Execution/Interpreter.cs +++ b/eiger/Execution/Interpreter.cs @@ -172,7 +172,7 @@ public static (bool, bool, Value) VisitBlockNode(ASTNode node, Dictionary symbolTable, ASTNode key, } else if (key.type == NodeType.Identifier) { + value.modifiers = symbolTable[key.value].modifiers; symbolTable[key.value] = value; } else if (key.type == NodeType.AttrAccess) diff --git a/eiger/stdlibs/event.ei b/eiger/stdlibs/event.ei index a450c8e..dd387f3 100644 --- a/eiger/stdlibs/event.ei +++ b/eiger/stdlibs/event.ei @@ -1,7 +1,7 @@ class Event let private subscribers = [] - func Event() end + func new() end func Subscribe(subscriber) subscribers += subscriber end diff --git a/eiger/stdlibs/iterator.ei b/eiger/stdlibs/iterator.ei index d254684..dfb9190 100644 --- a/eiger/stdlibs/iterator.ei +++ b/eiger/stdlibs/iterator.ei @@ -2,7 +2,7 @@ class Iterator let private iter let private length let private ptr = 0 - func Iterator(_iter) + func new(_iter) if _iter.type != "string" then if _iter.type != "array" then emitln("Not Iterable!")