summaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2023-01-03 14:41:57 -0800
committerPreston Pan <preston@nullring.xyz>2023-01-03 14:41:57 -0800
commitf8cedce5299d12adc3ce3249fd5b3a9fe5578c0a (patch)
treedf77b3d66798665b8c170a876fad00a412d922d7 /src/parser.c
parent41bfa91100b3ddf36496b5dff6e10bfd5394017d (diff)
hypothetically fixed bug
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c2
1 files changed, 2 insertions, 0 deletions
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;