function calling works in theory (can't test yet)
This commit is contained in:
@@ -336,6 +336,23 @@ struct GroundBytecode {
|
||||
GroundBytecodeHeap heap;
|
||||
};
|
||||
|
||||
|
||||
// --- Internal Ground components, avoid use outside of Ground ---
|
||||
|
||||
enum GroundExecutionResultType {
|
||||
_GER_CONTINUE, _GER_JUMP, _GER_RETURN, _GER_END
|
||||
};
|
||||
|
||||
struct GroundExecutionResult {
|
||||
enum GroundExecutionResultType type;
|
||||
union {
|
||||
GroundBytecodeValue value;
|
||||
GroundSize line;
|
||||
GroundInt end;
|
||||
} as;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// INTERFACE
|
||||
//
|
||||
@@ -428,6 +445,8 @@ struct _Ground {
|
||||
GroundState (*State) (GroundState* in);
|
||||
|
||||
GroundIdentifier* (*Identifier) (GroundIdentifier* in);
|
||||
|
||||
GroundBytecodeValue (*BytecodeValue) (GroundBytecodeValue* in);
|
||||
} Copy;
|
||||
|
||||
struct {
|
||||
@@ -481,11 +500,11 @@ struct _Ground {
|
||||
void (*save) (GroundBytecode* bytecode, const char* path);
|
||||
GroundBytecode (*load) (const char* path);
|
||||
struct {
|
||||
void (*execute) (GroundBytecodeProgram* program, GroundBytecodeHeap* heap);
|
||||
void (*optimise) (GroundBytecodeProgram* program);
|
||||
GroundBytecodeValue (*execute) (GroundBytecodeProgram* program, GroundBytecodeHeap* heap);
|
||||
void (*optimise) (GroundBytecodeProgram* program);
|
||||
} Program;
|
||||
struct {
|
||||
int64_t (*execute) (GroundBytecodeInstruction* instruction, GroundBytecodeHeap* heap);
|
||||
struct GroundExecutionResult (*execute) (GroundBytecodeInstruction* instruction, GroundBytecodeHeap* heap);
|
||||
} Instruction;
|
||||
struct {
|
||||
void (*set) (GroundBytecodeHeap* heap, GroundSize idx, GroundValue value);
|
||||
|
||||
Reference in New Issue
Block a user