summaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
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;