diff options
Diffstat (limited to 'api/vm.h')
-rw-r--r-- | api/vm.h | 32 |
1 files changed, 7 insertions, 25 deletions
@@ -16,23 +16,23 @@ typedef struct void *(*copy )(void *data); void (*delete)(void *data); char *(*print )(void *data); -} UwUVMNativeType; +} UwUVMType; typedef struct { void *data; - UwUVMNativeType *type; -} UwUVMNativeValue; + UwUVMType *type; +} UwUVMValue; typedef struct UwUVMArgs { size_t num; - struct UwUVMValue **evaluated; + UwUVMValue **evaluated; struct UwUVMExpression *unevaluated; struct UwUVMArgs *super; } UwUVMArgs; -typedef struct UwUVMValue (*UwUVMNativeFunction)(UwUVMArgs *args); +typedef UwUVMValue (*UwUVMNativeFunction)(UwUVMArgs *args); typedef struct { @@ -44,24 +44,6 @@ typedef struct } value; } UwUVMFunction; -typedef struct UwUVMValue -{ - enum - { - VT_INT, - VT_STR, - VT_REF, - VT_NAT, - } type; - union - { - int int_value; - char *str_value; - UwUVMFunction *ref_value; - UwUVMNativeValue nat_value; - } value; -} UwUVMValue; - typedef struct UwUVMExpression { ExpressionType type; @@ -83,8 +65,8 @@ typedef struct { void *api_library; UwUVMFunction *main_function; - UwUVMFunction **functions; - size_t num_functions; + UwUVMFunction **functions; + size_t num_functions; void **libraries; size_t num_libraries; } UwUVMProgram; |