ITS A HYDRA I FIXED A BUG BUT ANOTHER ONE POPPED UP

This commit is contained in:
2026-07-13 14:45:02 +10:00
parent 71dfbb5855
commit 7619b897e0

View File

@@ -132,6 +132,7 @@ static void doStruct(GroundProgram* program, GroundProgram* newProgram, GroundSt
// Parse struct body
bool parsing = true;
GroundSize fieldCount = 0;
while (parsing) {
(*i)++;
if (*i >= program->len) {
@@ -152,6 +153,7 @@ static void doStruct(GroundProgram* program, GroundProgram* newProgram, GroundSt
}
snprintf(field->name, 2047, "%s", instruction->args.at[0].as.ref->string);
field->offset = fieldCount++;
// If we know the value type now, add it to the instruction
if (instruction->args.at[1].type == GroundArg_Value) {
@@ -181,6 +183,7 @@ static void doStruct(GroundProgram* program, GroundProgram* newProgram, GroundSt
}
snprintf(field->name, 2047, "%s", instruction->args.at[0].as.ref->string);
field->offset = fieldCount++;
// If we know the type now, add it to the instruction
char* typeName = instruction->args.at[1].as.ref->string;
@@ -225,6 +228,9 @@ static void doStruct(GroundProgram* program, GroundProgram* newProgram, GroundSt
Ground.Free.Instruction(inst);
newProgram->len--;
// TODO do the rest of this
// for some reason I haven't done it yet?? oh well who cares
// Add 3 to signal addition of closure
Ground.Instruction.append(&output, (GroundArg) {.type = GroundArg_DirectRef, ._offset = 3});
break;