cool stuff

This commit is contained in:
2026-06-15 20:27:50 +10:00
parent 284b08b12a
commit 80140ed798
41 changed files with 470 additions and 4 deletions

View File

@@ -74,6 +74,8 @@ struct GroundFunction {
} program;
GroundState* closure;
size_t _requiredSize;
};
struct GroundStruct {
@@ -144,6 +146,8 @@ struct GroundArg {
const char* ref;
GroundValue value;
} as;
size_t _offset;
};
enum GroundInstructionType {
@@ -219,6 +223,8 @@ struct GroundVariable {
char name[2048];
GroundValue value;
UT_hash_handle hh;
size_t _offset;
};
struct GroundLabel {
@@ -237,6 +243,8 @@ struct GroundState {
GroundVariable* variables;
GroundLabel* labels;
GroundCatch* catches;
size_t _size;
};
//
@@ -344,6 +352,29 @@ struct _Ground {
struct {
void (*addField) (GroundStruct* gs, const char* id, GroundValue value);
} Struct;
struct {
GroundValue* (*findVariable) (GroundState* state, const char* id);
size_t* (*findLabel) (GroundState* state, const char* id);
GroundCatch* (*findCatch) (GroundState* state, const char* id);
} State;
struct {
void (*run)(GroundProgram* program, GroundState* state);
void (*giveUpAndCry)();
} Internal;
struct {
void (*Error) (const char* message);
void (*Warning) (const char* message);
void (*printErrors)();
char* errors[4096];
size_t errorCount;
char* warnings[4096];
size_t warningCount;
} Log;
};
extern struct _Ground Ground;