start adding error message support

This commit is contained in:
2025-07-09 01:55:40 +01:00
parent 9e5e932d39
commit e234ea074b
19 changed files with 293 additions and 115 deletions

View File

@@ -2,25 +2,13 @@
#define RUNTIME_H
#include "../translator/translator.h"
#include "internals/hashmap/hashmap.h"
#include "../returnTypes.h"
typedef struct {
ArgonObject **registers;
size_t head;
} RuntimeState;
typedef struct {
bool exists;
char *path;
int64_t line;
char *type;
char *message;
} ArErr;
typedef struct Stack {
ArgonObject *scope;
struct Stack *prev;
} Stack;
void init_types();
uint64_t pop_bytecode(Translated *translated, RuntimeState *state);
@@ -30,6 +18,8 @@ ArErr run_instruction(Translated *translated, RuntimeState *state,
RuntimeState init_runtime_state(Translated translated);
ArgonObject *runtime(Translated translated, RuntimeState state);
Stack create_scope(Stack *prev);
ArErr runtime(Translated translated, RuntimeState state, Stack stack);
#endif // RUNTIME_H