From d011d2beb43e0068132ff15007829ff32be30462 Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Mon, 2 Feb 2026 13:07:02 +1100 Subject: [PATCH] Expose GroundScope struct --- include/groundvm.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/groundvm.h b/include/groundvm.h index 89f0152..770f947 100644 --- a/include/groundvm.h +++ b/include/groundvm.h @@ -1,5 +1,6 @@ #ifndef LIBGROUND_H #define LIBGROUND_H +#define MAX_ID_LEN 64 /* * groundvm.h @@ -165,6 +166,24 @@ typedef struct GroundObject { GroundObjectField* fields; } GroundObject; +typedef struct GroundLabel { + char id[MAX_ID_LEN]; + int lineNum; + UT_hash_handle hh; +} GroundLabel; + +typedef struct GroundVariable { + char id[MAX_ID_LEN]; + GroundValue value; + UT_hash_handle hh; +} GroundVariable; + +typedef struct GroundScope { + GroundLabel** labels; + GroundVariable** variables; + bool isMainScope; +} GroundScope; + #ifdef __cplusplus extern "C" { #endif @@ -180,6 +199,8 @@ void groundAddValueToInstruction(GroundInstruction* inst, GroundValue value); void groundAddReferenceToInstruction(GroundInstruction* inst, GroundArg value); GroundArg groundCreateReference(GroundArgType type, char* ref); +void groundAddValueToScope(GroundScope* gs, const char* name, GroundValue value); + GroundValue groundCreateValue(GroundValueType type, ...); GroundProgram groundParseFile(const char* code);