feat: Remove semicolon after if statements

This commit is contained in:
overflowerror 2024-02-20 21:48:00 +01:00
parent 1970130145
commit 94f6441aaf
4 changed files with 14 additions and 14 deletions

View file

@ -74,18 +74,18 @@ stats: /* empty */
{
$$ = block_new();
}
| stats stat SEMICOLON
| stats stat
{
$$ = $1;
block_add_statement($$, $2);
}
;
stat: print
| definition
| assignment
stat: print SEMICOLON
| definition SEMICOLON
| assignment SEMICOLON
| if
| macrostat
| macrostat SEMICOLON
;
print: PRINT expr

View file

@ -2,18 +2,18 @@ if 1 {
print "foo\n";
} else {
print "bar\n";
};
}
if 0 {
print "foobar\n";
} else {
print "baz\n";
};
}
if 1 {
print "no else\n";
};
}
if 0 {
print "this should not be printed\n";
};
}

View file

@ -5,10 +5,10 @@ if a {
if (a + 1) {
print "b\n";
};
}
var b = (a - 1);
if b {
print "c\n";
};
};
}
}

View file

@ -1,7 +1,7 @@
if 1 {
var b = 0;
};
}
if 1 {
var b = 1;
};
}