make native function support and start working on support for error catching

This commit is contained in:
William Bell
2025-08-06 22:31:31 +01:00
parent c567b59459
commit 4b6d15336a
9 changed files with 91 additions and 44 deletions

View File

@@ -14,6 +14,12 @@
typedef struct StackFrame StackFrame;
typedef struct RuntimeState RuntimeState;
typedef struct ErrorCatch {
size_t jump_to;
Stack *stack;
StackFrame *stackFrame;
} ErrorCatch;
typedef struct RuntimeState {
ArgonObject **registers;
size_t head;
@@ -21,6 +27,7 @@ typedef struct RuntimeState {
StackFrame **currentStackFramePointer;
ArgonObject*** call_args;
size_t* call_args_length;
DArray catch_errors; // ErrorCatch[]
} RuntimeState;
typedef struct StackFrame {
@@ -28,7 +35,6 @@ typedef struct StackFrame {
RuntimeState state;
Stack *stack;
StackFrame *previousStackFrame;
ArErr err;
uint64_t depth;
} StackFrame;