object initialisation
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "../../include/ground.h"
|
||||
#include "../include/estr.h"
|
||||
#include <inttypes.h>
|
||||
|
||||
char* _GroundStringifyBytecodeValue(GroundBytecodeValue* value) {
|
||||
@@ -53,10 +54,24 @@ char* _GroundStringifyBytecodeValue(GroundBytecodeValue* value) {
|
||||
// TODO implement function stringification
|
||||
}
|
||||
case GroundType_Struct: {
|
||||
// TODO implement struct stringification
|
||||
Estr str = CREATE_ESTR("<struct fields: { ");
|
||||
for (GroundSize i = 0; i < value->as.Struct.size; i++) {
|
||||
char* field = Ground.Stringify.BytecodeValue(&value->as.Struct.values[i]);
|
||||
APPEND_ESTR(str, field);
|
||||
free(field);
|
||||
}
|
||||
APPEND_ESTR(str, " }>");
|
||||
return str.str;
|
||||
}
|
||||
case GroundType_Object: {
|
||||
// TODO implement object stringification
|
||||
Estr str = CREATE_ESTR("<object fields: { ");
|
||||
for (GroundSize i = 0; i < value->as.Struct.size; i++) {
|
||||
char* field = Ground.Stringify.BytecodeValue(&value->as.Struct.values[i]);
|
||||
APPEND_ESTR(str, field);
|
||||
free(field);
|
||||
}
|
||||
APPEND_ESTR(str, " }>");
|
||||
return str.str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user