mirror of
https://github.com/janet-lang/janet
synced 2025-01-25 22:56:52 +00:00
Fix startup environment.
This commit is contained in:
parent
2541806dc1
commit
427b2638e0
@ -2,6 +2,8 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
- Add `cli-main` function to the core, which invokes Janet's CLI interface.
|
||||||
|
This basically moves what was init.janet into boot.janet.
|
||||||
- Improve flychecking, and fix flyching bugs introduced in 1.4.0.
|
- Improve flychecking, and fix flyching bugs introduced in 1.4.0.
|
||||||
- Add `prin`, `eprint`, `eprintf` and `eprin` functions. The
|
- Add `prin`, `eprint`, `eprintf` and `eprin` functions. The
|
||||||
functions prefix with e print to `(dyn :err stderr)`
|
functions prefix with e print to `(dyn :err stderr)`
|
||||||
|
@ -88,7 +88,9 @@ int main(int argc, char **argv) {
|
|||||||
Janet mainfun, out;
|
Janet mainfun, out;
|
||||||
janet_resolve(env, janet_csymbol("cli-main"), &mainfun);
|
janet_resolve(env, janet_csymbol("cli-main"), &mainfun);
|
||||||
Janet mainargs[1] = { janet_wrap_array(args) };
|
Janet mainargs[1] = { janet_wrap_array(args) };
|
||||||
status = janet_pcall(janet_unwrap_function(mainfun), 1, mainargs, &out, NULL);
|
JanetFiber *fiber = janet_fiber(janet_unwrap_function(mainfun), 64, 1, mainargs);
|
||||||
|
fiber->env = env;
|
||||||
|
status = janet_continue(fiber, janet_wrap_nil(), &out);
|
||||||
|
|
||||||
/* Deinitialize vm */
|
/* Deinitialize vm */
|
||||||
janet_deinit();
|
janet_deinit();
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
# Body
|
# Body
|
||||||
(each path (tuple/slice (dyn :args) 1)
|
(each path (tuple/slice (dyn :args) 1)
|
||||||
|
(print "\n/* " path " */\n")
|
||||||
(print (slurp path)))
|
(print (slurp path)))
|
||||||
|
|
||||||
# maybe will help
|
# maybe will help
|
||||||
|
Loading…
Reference in New Issue
Block a user