diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-12-30 16:53:37 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-12-30 16:53:37 +0100 |
commit | 4c52777ca9e52edd0bff76168d886de9757ea457 (patch) | |
tree | 385c548fbae43f4b4764a1c32d5babe60c84aa4d /src | |
parent | 058d954e80f83c26deb209008f11d87a5b59418e (diff) | |
download | uwu-lang-4c52777ca9e52edd0bff76168d886de9757ea457.tar.xz |
Add :ref module and refactor type handling
Diffstat (limited to 'src')
-rw-r--r-- | src/vm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -20,14 +20,14 @@ static void free_expression(UwUVMExpression *expr) void vm_run_file(const char *progname, const char *modname) { UwUVMProgram program = create_program(progname, modname); - UwUVMValue result = ((UwUVMValue (*)(UwUVMFunction *, UwUVMArgs args)) dlsym(program.api_library, "uwuvm_run_function"))(program.main_function, (UwUVMArgs) {.num = 0, .evaluated = NULL, .unevaluated = NULL, .super = NULL}); + UwUVMValue result = ((UwUVMValue (*)(UwUVMFunction *, size_t, UwUVMExpression *, UwUVMArgs *)) dlsym(program.api_library, "uwuvm_call_function"))(program.main_function, 0, NULL, NULL); - char *str = ((char *(*)(UwUVMValue)) dlsym(program.api_library, "uwustr_get"))(result); + char *str = ((char *(*)(UwUVMValue)) dlsym(program.api_library, "uwuvm_print_value"))(result); printf("%s\n", str); free(str); - ((void (*)(UwUVMValue)) dlsym(program.api_library, "uwuvm_free_value"))(result); + ((void (*)(UwUVMValue)) dlsym(program.api_library, "uwuvm_delet_value"))(result); for (size_t i = 0; i < program.num_functions; i++) { UwUVMFunction *function = program.functions[i]; |