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

Add var and def. Make them behave the same

but have different implementations in top
level scope in order to enable incremental compilation and repl.
This commit is contained in:
Calvin Rose
2017-06-25 16:36:20 -04:00
parent c3d65cb91d
commit 29a39c47b0
8 changed files with 371 additions and 105 deletions

View File

@@ -34,8 +34,7 @@ int debug_compile_and_run(Gst *vm, GstValue ast, GstValue last) {
GstValue func;
/* Try to compile generated AST */
gst_compiler(&c, vm);
gst_compiler_usemodule(&c, "std");
gst_compiler_global(&c, "_", last);
gst_env_putc(vm, vm->env, "_", last);
func = gst_wrap_function(gst_compiler_compile(&c, ast));
/* Check for compilation errors */
if (c.error.type != GST_NIL) {