1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-28 22:27:41 +00:00

Remove symbol type in favor of only strings. Anticipate

addition of struct type, which will be an immutable hashtable.
This commit is contained in:
Calvin Rose
2017-04-14 13:41:32 -04:00
parent e28e31f818
commit 20bb5a18f7
10 changed files with 31 additions and 50 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_csymbol(&vm, "ans")));
gst_compiler_global(&c, "ans", gst_object_get(vm.rootenv, gst_load_cstring(&vm, "ans")));
func.type = GST_FUNCTION;
func.data.function = gst_compiler_compile(&c, p.value);
@@ -73,12 +73,6 @@ void debug_repl(FILE *in, FILE *out) {
continue;
}
/* Print asm */
/*if (out) {
fprintf(out, "\n");
gst_dasm_function(out, func.data.function);
}*/
/* Execute function */
if (gst_run(&vm, func)) {
if (out) {
@@ -94,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_csymbol(&vm, "ans"), vm.ret);
gst_object_put(&vm, vm.rootenv, gst_load_cstring(&vm, "ans"), vm.ret);
}
}