]> git.lizzy.rs Git - nothing.git/blob - src/script_test.c
TODO(#296)
[nothing.git] / src / script_test.c
1 #include <stdio.h>
2 #include <string.h>
3
4 #include "script/parser.h"
5
6 int main(int argc, char *argv[])
7 {
8     (void) argc;
9     (void) argv;
10
11     const char *code = "(1 . (\"2\" . hello-world))";
12     size_t cursor = 0;
13     const size_t n = strlen(code);
14
15     struct ParseResult result = create_expr_from_str(code, &cursor, n);
16
17     if (result.is_error) {
18         print_parse_error(stderr, code, result.error);
19     } else {
20         print_expr_as_sexpr(result.expr);
21     }
22
23     return 0;
24 }