1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-15 21:24:48 +00:00
janet/unittests/parse_test.c
bakpakin 01a95426b3 More work on compiler. Add compiler unit test that currently
segfaults alot. Added dst_disasm to reconstruct dsts assembly
from a funcdef.
2017-12-16 23:11:51 -05:00

20 lines
395 B
C

#include "unit.h"
#include <dst/dst.h>
int main() {
DstParseResult pres;
const uint8_t *str;
dst_init();
pres = dst_parsec("'(+ 1 () [] 3 5 :hello \"hi\\h41\")");
assert(pres.status == DST_PARSE_OK);
assert(dst_checktype(pres.value, DST_TUPLE));
str = dst_to_string(pres.value);
printf("%.*s\n", dst_string_length(str), (const char *) str);
return 0;
}