applets/c2english: fix switch case labels

This commit is contained in:
Pragmatic Software 2023-09-21 16:53:21 -07:00
parent 59b7ee7115
commit eb301ea948
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE
2 changed files with 4 additions and 4 deletions

View File

@ -424,7 +424,7 @@ labeled_statement:
identifier ':' statement[context => 'label'] (';')(?) identifier ':' statement[context => 'label'] (';')(?)
{ "Let there be a label $item{identifier}.\n$item{statement}" } { "Let there be a label $item{identifier}.\n$item{statement}" }
| ('case' constant_expression | ('case' constant_expression
{ $item{constant_expression} } { $return = $item{constant_expression} }
':')(s) ':')(s)
{ {
my @items = @{$item[1]}; my @items = @{$item[1]};
@ -444,7 +444,7 @@ labeled_statement:
} elsif (not length $statements and not $last) { } elsif (not length $statements and not $last) {
$statements = "Do nothing.\n"; $statements = "Do nothing.\n";
} }
$return = "If it has the value $item[-2], ^L$statements$last"; $return = "If it has the value $item[1]->[0], ^L$statements$last";
} }
| 'default' ':' statement | 'default' ':' statement
{ "In the default case, ^L$item{statement}" } { "In the default case, ^L$item{statement}" }

View File

@ -25,8 +25,8 @@ use PBot::Imports;
# These are set by the /misc/update_version script # These are set by the /misc/update_version script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 4683, BUILD_REVISION => 4685,
BUILD_DATE => "2023-08-19", BUILD_DATE => "2023-09-21",
}; };
sub initialize {} sub initialize {}