diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2026-02-25 22:54:10 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2026-02-25 22:55:35 +0200 |
| commit | 0dd32cca3b8ad7e2a34ec815996e68e2f81c1da1 (patch) | |
| tree | 17227de8682888a254e5b57b955246c9c6c59b80 /src/parser.y | |
| parent | ee50ee4ef760521c0764177b3bb8fed25beb2092 (diff) | |
| download | fwd-0dd32cca3b8ad7e2a34ec815996e68e2f81c1da1.tar.gz fwd-0dd32cca3b8ad7e2a34ec815996e68e2f81c1da1.zip | |
filter out empty nodes from statement list
+ Fixes tail call analysis that was accidentally broken by
64146b46da45ce69ab380add00459f7b60fe9196
+ Kind of wasteful to first allocate empty node and then just throw it
away, but I don't have any better ideas at the moment
Diffstat (limited to 'src/parser.y')
| -rw-r--r-- | src/parser.y | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parser.y b/src/parser.y index dad3210..6210a95 100644 --- a/src/parser.y +++ b/src/parser.y @@ -454,7 +454,10 @@ rev_statements | statement statements - : rev_statements { $$ = reverse_ast_list($1); fix_closures($$); } + : rev_statements { + $$ = filter_empty(reverse_ast_list($1)); + fix_closures($$); + } opt_statements : statements |
