diff options
author | Preston Pan <preston@nullring.xyz> | 2023-01-03 14:41:57 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2023-01-03 14:41:57 -0800 |
commit | f8cedce5299d12adc3ce3249fd5b3a9fe5578c0a (patch) | |
tree | df77b3d66798665b8c170a876fad00a412d922d7 | |
parent | 41bfa91100b3ddf36496b5dff6e10bfd5394017d (diff) |
hypothetically fixed bug
-rw-r--r-- | src/include/.ast.h.swp | bin | 12288 -> 0 bytes | |||
-rw-r--r-- | src/parser.c | 2 | ||||
-rw-r--r-- | src/visitor.c | 10 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/include/.ast.h.swp b/src/include/.ast.h.swp Binary files differdeleted file mode 100644 index 355bb9f..0000000 --- a/src/include/.ast.h.swp +++ /dev/null diff --git a/src/parser.c b/src/parser.c index 92e9ccf..7f174a5 100644 --- a/src/parser.c +++ b/src/parser.c @@ -212,6 +212,8 @@ ast_t *parse_all(parser_t *parser) { int i = 0; while (t != NULL) { cur = parse_expr(parser); + if (cur == NULL) + continue; i++; asts = realloc(asts, i * sizeof(ast_t *)); asts[i - 1] = cur; diff --git a/src/visitor.c b/src/visitor.c index 6eb29a2..1e14c2e 100644 --- a/src/visitor.c +++ b/src/visitor.c @@ -64,6 +64,14 @@ ast_t *eval_expr(visitor_t *v, ast_t *e) { } } -ast_t *eval(visitor_t *v) {} +ast_t *eval(visitor_t *v) { + ast_t *cur; + ast_t *root; + ast_t **eval_nodes; + int j = 0; + for (int i = 0; i < v->root->root_size; i++) { + cur = eval_expr(v, v->root->subnodes[i]); + } +} void eval_error(visitor_t *v, ast_t *e) { exit(1); } |