1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-18 00:05:13 +00:00

Rename DstValue to Dst for easier access. Move vector.c into

util.c and make public API smaller. Pad strings and symbols with
extra 0 byte for better interop with C.
This commit is contained in:
bakpakin
2018-01-06 11:09:15 -05:00
parent 2771171658
commit 605848b217
31 changed files with 644 additions and 560 deletions

View File

@@ -30,7 +30,7 @@
#define DST_CLIENT_REPL 8
#define DST_CLIENT_UNKNOWN 16
static DstValue env;
static Dst env;
static int client_strequal(const char *a, const char *b) {
while (*a) if (*a++ != *b++) return 0;
@@ -115,7 +115,7 @@ static int repl() {
if (cres.status == DST_COMPILE_OK) {
/*dst_puts(dst_formatc("asm: %v\n", dst_disasm(cres.funcdef)));*/
DstFunction *f = dst_compile_func(cres);
DstValue ret;
Dst ret;
if (dst_run(dst_wrap_function(f), &ret)) {
dst_puts(dst_formatc("runtime error: %S\n", dst_to_string(ret)));
} else {
@@ -159,7 +159,7 @@ static void runfile(const uint8_t *src, int32_t len) {
opts.env = env;
cres = dst_compile(opts);
if (cres.status == DST_COMPILE_OK) {
DstValue ret = dst_wrap_nil();
Dst ret = dst_wrap_nil();
DstFunction *f = dst_compile_func(cres);
if (dst_run(dst_wrap_function(f), &ret)) {
dst_puts(dst_formatc("runtime error: %v\n", ret));