Skip to content

Commit

Permalink
Some more stuff fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Vardan2009 committed Aug 22, 2024
1 parent 326db47 commit 4f57215
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions eiger/Execution/BuiltInTypes/Array.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion eiger/Execution/Interpreter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static (bool, bool, Value) VisitBlockNode(ASTNode node, Dictionary<string

int step = value < toValue ? 1 : -1;

SetSymbol(localSymbolTable, node.children[0], new Number(node.filename, node.line, node.pos, value));
localSymbolTable[node.children[0].value] = new Number(node.filename, node.line, node.pos, value);

while (value != toValue)
{
Expand Down Expand Up @@ -752,6 +752,7 @@ public static void SetSymbol(Dictionary<string, Value> 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)
Expand Down
2 changes: 1 addition & 1 deletion eiger/stdlibs/event.ei
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Event
let private subscribers = []

func Event() end
func new() end

func Subscribe(subscriber) subscribers += subscriber end

Expand Down
2 changes: 1 addition & 1 deletion eiger/stdlibs/iterator.ei
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down

0 comments on commit 4f57215

Please sign in to comment.