Updated Toy, tweaked code to match new API

This commit is contained in:
2023-02-14 22:19:08 +00:00
parent 5efabde476
commit 9a1d81b7fb
14 changed files with 1610 additions and 2018 deletions

View File

@@ -106,15 +106,15 @@ Toy_Literal Box_callEngineNodeLiteral(Box_EngineNode* node, Toy_Interpreter* int
Toy_initLiteralArray(&arguments);
Toy_initLiteralArray(&returns);
//feed the arguments in backwards!
//feed the arguments in
Toy_pushLiteralArray(&arguments, n);
if (args) {
for (int i = args->count -1; i >= 0; i--) {
for (int i = 0; i < args->count; i++) {
Toy_pushLiteralArray(&arguments, args->literals[i]);
}
}
Toy_pushLiteralArray(&arguments, n);
Toy_callLiteralFn(interpreter, fn, &arguments, &returns);
ret = Toy_popLiteralArray(&returns);
@@ -151,15 +151,15 @@ void Box_callRecursiveEngineNodeLiteral(Box_EngineNode* node, Toy_Interpreter* i
Toy_initLiteralArray(&arguments);
Toy_initLiteralArray(&returns);
//feed the arguments in backwards!
//feed the arguments in
Toy_pushLiteralArray(&arguments, n);
if (args) {
for (int i = args->count -1; i >= 0; i--) {
for (int i = 0; i < args->count; i++) {
Toy_pushLiteralArray(&arguments, args->literals[i]);
}
}
Toy_pushLiteralArray(&arguments, n);
Toy_callLiteralFn(interpreter, fn, &arguments, &returns);
Toy_freeLiteralArray(&arguments);