]> git.lizzy.rs Git - uwu-lang.git/blobdiff - api/vm.h
Allow passing arguments to program, refactor directory structure
[uwu-lang.git] / api / vm.h
index 81465f83b7088792b3885e0887d6f45b7c597a9a..fc761d3e3f9815eef779082e682337cb4fad029b 100644 (file)
--- a/api/vm.h
+++ b/api/vm.h
@@ -3,7 +3,6 @@
 
 #include <stddef.h>
 #include <stdbool.h>
-#include "../src/expression.h"
 
 typedef enum
 {
@@ -11,6 +10,16 @@ typedef enum
        MODULE_NATIVE,
 } UwUVMModuleType;
 
+typedef enum
+{
+       EX_UNINIT,
+       EX_INTLIT,
+       EX_STRLIT,
+       EX_ARGNUM,
+       EX_FNNAME,
+       EX_FNCALL,
+} UwUVMExpressionType;
+
 typedef struct
 {
        void *(*clone)(void *data);
@@ -46,7 +55,7 @@ typedef struct
 
 typedef struct UwUVMExpression
 {
-       ExpressionType type;
+       UwUVMExpressionType type;
        union
        {
                struct
@@ -61,16 +70,6 @@ typedef struct UwUVMExpression
        } value;
 } UwUVMExpression;
 
-typedef struct
-{
-       void *api_library;
-       UwUVMFunction *main_function;
-       UwUVMFunction     **functions;
-       size_t          num_functions;
-       void     **libraries;
-       size_t num_libraries;
-} UwUVMProgram;
-
 UwUVMValue uwuvm_clone_value(UwUVMValue value);
 void       uwuvm_delet_value(UwUVMValue value);
 char      *uwuvm_print_value(UwUVMValue value);