-#include "u_lsl.h"
-#include "m_mem.h"
+#include "l_lsl.h"
+#include "u_mem.h"
struct l_lsl_vm l_lsl_vm_init() {
struct l_lsl_vm v;
}
void l_lsl_vm_free(struct l_lsl_vm *vm) {
+ LRTS_UNUSED(vm);
+}
+
+enum l_lsl_error l_lsl_compile_file(struct l_lsl_vm *v, const char *path) {
+ enum l_lsl_error err = L_LSL_ERR_OK;
+ LRTS_UNUSED(v);
+ LRTS_UNUSED(path);
+
+ return err;
+}
+
+enum l_lsl_error l_lsl_exec(struct l_lsl_vm *v, const char *path) {
+ enum l_lsl_error err = L_LSL_ERR_OK;
+
+ err = l_lsl_compile_file(v, path);
+
+ return err;
}
u32 max_len;
};
+struct l_lsl_table;
+
+union l_lsl_tableent_data {
+ i32 int_val;
+ char *str_val;
+ struct l_lsl_table *table;
+ /* start of code in bytecode table */
+ u32 function_code_index;
+};
+
/* a table entry is a single value
* of a specific data type */
struct l_lsl_tableent {
/* string table entry */
u32 name;
enum l_lsl_data_type type;
-
+ union l_lsl_tableent_data data;
};
/*
* if the entry point is NULL the global scope is executed */
enum l_lsl_error l_lsl_run(struct l_lsl_vm *v, const char *entry);
+/* compiles from a file */
+enum l_lsl_error l_lsl_compile_file(struct l_lsl_vm *v, const char *path);
+
+/* loads a file, compiles it and runs it */
+enum l_lsl_error l_lsl_exec(struct l_lsl_vm *v, const char *path);
+
#endif