1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-15 14:57:22 +00:00

Add context functions for more uniform interface

This commit is contained in:
bakpakin
2018-01-16 23:18:45 -05:00
parent 23196ff6a2
commit d373d38aee
15 changed files with 684 additions and 519 deletions

View File

@@ -117,7 +117,6 @@ static int repl() {
{
opts.source = res.value;
opts.flags = 0;
opts.sourcemap = res.map;
opts.env = env;
cres = dst_compile(opts);
if (cres.status == DST_COMPILE_OK) {
@@ -167,7 +166,6 @@ static void runfile(const uint8_t *src, int32_t len) {
{
opts.source = res.value;
opts.flags = 0;
opts.sourcemap = res.map;
opts.env = env;
cres = dst_compile(opts);
if (cres.status == DST_COMPILE_OK) {
@@ -290,7 +288,9 @@ int main(int argc, char **argv) {
/* Run a repl if nothing else happened, or the flag is set */
if (!fileRead || (flags & DST_CLIENT_REPL)) {
status = repl();
DstContext ctxt;
dst_context_repl(&ctxt, env);
status = dst_context_run(&ctxt);
}
dst_deinit();