Experimenting with cleaning up loopy code

This commit is contained in:
2023-02-28 17:29:37 +11:00
parent efc1e764d2
commit 12fa434e0f
2 changed files with 112 additions and 151 deletions

View File

@@ -621,7 +621,7 @@ int Toy_private_index(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments)
//simple indexing assignment if second is null
if (TOY_IS_NULL(second)) {
bool ret = -1;
int ret = -1;
if (!Toy_setLiteralArray(TOY_AS_ARRAY(compound), first, assign)) {
interpreter->errorOutput("Array index out of bounds in assignment");
@@ -629,6 +629,7 @@ int Toy_private_index(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments)
}
else {
Toy_pushLiteralArray(&interpreter->stack, compound); //leave the array on the stack
//...
ret = 1;
}