ITS A HYDRA I FIXED A BUG BUT ANOTHER ONE POPPED UP
This commit is contained in:
@@ -132,6 +132,7 @@ static void doStruct(GroundProgram* program, GroundProgram* newProgram, GroundSt
|
|||||||
|
|
||||||
// Parse struct body
|
// Parse struct body
|
||||||
bool parsing = true;
|
bool parsing = true;
|
||||||
|
GroundSize fieldCount = 0;
|
||||||
while (parsing) {
|
while (parsing) {
|
||||||
(*i)++;
|
(*i)++;
|
||||||
if (*i >= program->len) {
|
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);
|
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 we know the value type now, add it to the instruction
|
||||||
if (instruction->args.at[1].type == GroundArg_Value) {
|
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);
|
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
|
// If we know the type now, add it to the instruction
|
||||||
char* typeName = instruction->args.at[1].as.ref->string;
|
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);
|
Ground.Free.Instruction(inst);
|
||||||
newProgram->len--;
|
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
|
// Add 3 to signal addition of closure
|
||||||
Ground.Instruction.append(&output, (GroundArg) {.type = GroundArg_DirectRef, ._offset = 3});
|
Ground.Instruction.append(&output, (GroundArg) {.type = GroundArg_DirectRef, ._offset = 3});
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user