1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-29 06:37:41 +00:00

Add struct type.

This commit is contained in:
Calvin Rose
2017-04-15 16:05:59 -04:00
parent 20bb5a18f7
commit e90b66af58
17 changed files with 613 additions and 436 deletions

View File

@@ -59,7 +59,7 @@ void debug_repl(FILE *in, FILE *out) {
gst_compiler(&c, &vm);
func.type = GST_NIL;
gst_compiler_usemodule(&c, "std");
gst_compiler_global(&c, "ans", gst_object_get(vm.rootenv, gst_load_cstring(&vm, "ans")));
gst_compiler_global(&c, "ans", gst_object_get(vm.rootenv, gst_string_cv(&vm, "ans")));
func.type = GST_FUNCTION;
func.data.function = gst_compiler_compile(&c, p.value);
@@ -88,7 +88,7 @@ void debug_repl(FILE *in, FILE *out) {
continue;
} else if (out) {
fprintf(out, "%s\n", (char *)gst_to_string(&vm, vm.ret));
gst_object_put(&vm, vm.rootenv, gst_load_cstring(&vm, "ans"), vm.ret);
gst_object_put(&vm, vm.rootenv, gst_string_cv(&vm, "ans"), vm.ret);
}
}