1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-29 18:00:26 +00:00

Add -env- to repl.

This commit is contained in:
bakpakin 2017-07-09 16:44:45 -04:00
parent 53cead0bab
commit 6a8ec0c895
4 changed files with 4 additions and 4 deletions

View File

@ -171,6 +171,7 @@ static int debug_repl(Gst *vm, uint64_t flags) {
continue;
}
gst_env_putc(vm, vm->env, "_", vm->ret);
gst_env_putc(vm, vm->env, "-env-", gst_wrap_table(vm->env));
if (!debug_compile_and_run(vm, gst_parse_consume(&p), flags)) {
printf_flags(flags, "36", "%s\n", (const char *) gst_description(vm, vm->ret));
}

View File

@ -422,7 +422,7 @@ static int symbol_resolve(GstCompiler *c, GstValue x, uint16_t *level, uint16_t
GstTable *metas = gst_env_meta(c->vm, c->env);
GstValue maybeMeta = gst_table_get(metas, x);
if (maybeMeta.type == GST_TABLE) {
GstValue isMutable = gst_table_get(maybeMeta.data.table, gst_string_cvs(c->vm, "mutable"));
GstValue isMutable = gst_table_get(maybeMeta.data.table, gst_string_cv(c->vm, "mutable"));
if (gst_truthy(isMutable)) {
if (flags) *flags = GST_LOCAL_FLAG_MUTABLE;
*out = check;

View File

@ -295,5 +295,4 @@ GstValue gst_table_next(GstTable *t, GstValue key) {
return bucket[0];
}
return gst_wrap_nil();
}
}

View File

@ -445,7 +445,7 @@ void gst_env_putvar(Gst *vm, GstTable *env, GstValue key, GstValue value) {
ref->count = 1;
ref->data[0] = value;
gst_table_put(vm, env, key, gst_wrap_array(ref));
gst_table_put(vm, newmeta, gst_string_cvs(vm, "mutable"), gst_wrap_boolean(1));
gst_table_put(vm, newmeta, gst_string_cv(vm, "mutable"), gst_wrap_boolean(1));
gst_table_put(vm, meta, key, gst_wrap_table(newmeta));
}