fix: empty statements caused error

This commit is contained in:
overflowerror 2024-05-18 11:27:33 +02:00
parent 3f0b407cb3
commit acf8c7a2d0
3 changed files with 9 additions and 1 deletions

View file

@ -99,7 +99,9 @@ stats: /* empty */
| stats stat
{
$$ = $1;
block_add_statement($$, $2);
if ($2 != NULL) {
block_add_statement($$, $2);
}
}
;
@ -109,6 +111,10 @@ stat: definition SEMICOLON
| if
| while
| map
| SEMICOLON
{
$$ = NULL;
}
;
definition: VAR assignment

View file

@ -0,0 +1 @@
;;print("foo\n");

View file

@ -0,0 +1 @@
[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++<<<.>.>.>.