mirror of
https://github.com/sigmasternchen/macrofuck
synced 2025-03-15 07:08:56 +00:00
fix: empty statements caused error
This commit is contained in:
parent
3f0b407cb3
commit
acf8c7a2d0
3 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
1
compiler/test/cases/025d-bug-emtpy-statements.in
Normal file
1
compiler/test/cases/025d-bug-emtpy-statements.in
Normal file
|
@ -0,0 +1 @@
|
|||
;;print("foo\n");
|
1
compiler/test/cases/025d-bug-emtpy-statements.out
Normal file
1
compiler/test/cases/025d-bug-emtpy-statements.out
Normal file
|
@ -0,0 +1 @@
|
|||
[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++<<<.>.>.>.
|
Loading…
Reference in a new issue