add multiplication, division, and &&

This commit is contained in:
William Bell
2025-09-03 05:21:41 +01:00
parent df040adf45
commit 57728af0b6
10 changed files with 286 additions and 31 deletions

View File

@@ -6,6 +6,7 @@
#include "call.h"
#include "../../hash_data/hash_data.h"
#include "../objects/literals/literals.h"
#include "../objects/string/string.h"
#include <inttypes.h>
#include <math.h>
@@ -143,7 +144,8 @@ void run_call(ArgonObject *original_object, size_t argc, ArgonObject **argv,
object->value.argon_fn.bytecode_length, false},
object->value.argon_fn.translated.constants,
object->value.argon_fn.translated.path},
{ar_alloc(object->value.argon_fn.translated.registerCount * sizeof(ArgonObject *)),
{ar_alloc(object->value.argon_fn.translated.registerCount *
sizeof(ArgonObject *)),
0,
object->value.argon_fn.translated.path,
NULL,
@@ -153,6 +155,9 @@ void run_call(ArgonObject *original_object, size_t argc, ArgonObject **argv,
scope,
*state->currentStackFramePointer,
(*state->currentStackFramePointer)->depth + 1};
for (size_t i = 0; i < new_stackFrame.translated.registerCount; i++) {
new_stackFrame.state.registers[i] = ARGON_NULL;
}
if (CStackFrame) {
runtime(new_stackFrame.translated, new_stackFrame.state,
new_stackFrame.stack, err);