3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-22 03:49:29 +01:00

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'] (';')(?)
{ "Let there be a label $item{identifier}.\n$item{statement}" }
| ('case' constant_expression
{ $item{constant_expression} }
{ $return = $item{constant_expression} }
':')(s)
{
my @items = @{$item[1]};
@ -444,7 +444,7 @@ labeled_statement:
} elsif (not length $statements and not $last) {
$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
{ "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
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 4683,
BUILD_DATE => "2023-08-19",
BUILD_REVISION => 4685,
BUILD_DATE => "2023-09-21",
};
sub initialize {}