diff --git a/compile.c b/compile.c index 295cc140..bebf46ad 100644 --- a/compile.c +++ b/compile.c @@ -982,11 +982,6 @@ static SpecialFormHelper get_special(GstArray *form) { if (gst_string_length(name) == 2 && name[1] == 'o') { return compile_do; - } else if (gst_string_length(name) == 4 && - name[1] == 'i' && - name[2] == 'c' && - name[3] == 't') { - return compile_object; } } break; @@ -1014,6 +1009,15 @@ static SpecialFormHelper get_special(GstArray *form) { return compile_not; } } + break; + case 'o': + { + if (gst_string_length(name) == 3 && + name[1] == 'b' && + name[2] == 'j') { + return compile_object; + } + } case 'q': { if (gst_string_length(name) == 5 && diff --git a/disasm.c b/disasm.c index d03a4d5b..e4eedf7e 100644 --- a/disasm.c +++ b/disasm.c @@ -176,7 +176,7 @@ void gst_dasm(FILE * out, uint16_t *byteCode, uint32_t len) { current += dasm_varg_op(out, current, "array", 1); break; case GST_OP_DIC: - current += dasm_varg_op(out, current, "dictionary", 1); + current += dasm_varg_op(out, current, "object", 1); break; case GST_OP_TCL: current += dasm_varg_op(out, current, "tailCall", 1); diff --git a/main.c b/main.c index 2bc3e1be..2adba306 100644 --- a/main.c +++ b/main.c @@ -87,9 +87,9 @@ void debugRepl() { } /* Print asm */ - //printf("\n"); - //dasmFunc(stdout, func.data.func); - //printf("\n"); + printf("\n"); + gst_dasm_function(stdout, func.data.function); + printf("\n"); /* Execute function */ gst_load(&vm, func); diff --git a/parse.c b/parse.c index 68ea5a8c..6ec7f2f8 100644 --- a/parse.c +++ b/parse.c @@ -89,7 +89,7 @@ static void parser_push(GstParser *p, ParseType type, uint8_t character) { } if (character == '{') { top->buf.form.endDelimiter = '}'; - gst_array_push(p->vm, top->buf.form.array, gst_load_cstring(p->vm, "dict")); + gst_array_push(p->vm, top->buf.form.array, gst_load_cstring(p->vm, "obj")); } break; } diff --git a/vm.c b/vm.c index 88e7a66c..482e2917 100644 --- a/vm.c +++ b/vm.c @@ -223,6 +223,7 @@ static void gst_mark(Gst *vm, GstValue *x) { for (i = 0; i < x->data.object->capacity; ++i) { bucket = x->data.object->buckets[i]; while (bucket) { + gc_header(bucket)->color = vm->black; gst_mark(vm, &bucket->key); gst_mark(vm, &bucket->value); bucket = bucket->next;