mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 04:19:27 +01:00
CGrammar: Emit "Do nothing" for empty case statements
This commit is contained in:
parent
7f293450ef
commit
3e47f6bc58
@ -13,7 +13,7 @@ use warnings;
|
||||
# These are set automatically by the build/commit script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 738,
|
||||
BUILD_REVISION => 739,
|
||||
BUILD_DATE => "2014-07-17",
|
||||
};
|
||||
|
||||
|
@ -421,6 +421,8 @@ labeled_statement:
|
||||
my $statements = join('', @{$item[-1]});
|
||||
if (length $statements and $statements !~ /Exit switch block\.\s*$/) {
|
||||
$statements .= "Fall through to the next case.\n";
|
||||
} elsif (not length $statements and not $last) {
|
||||
$statements = "Do nothing.\n";
|
||||
}
|
||||
$return = "If it has the value $item[-2], ^L$statements$last";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user