3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-23 04:19:27 +01:00

CGrammar: Fix for loop init and break statement

This commit is contained in:
Pragmatic Software 2014-07-17 19:04:09 +00:00
parent a59cc20128
commit 7f293450ef
2 changed files with 4 additions and 3 deletions

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 737,
BUILD_REVISION => 738,
BUILD_DATE => "2014-07-17",
};

View File

@ -358,7 +358,8 @@ jump_statement:
if ($arg{context} =~ /switch/ or $arg{context} =~ /case/) {
$return = "Exit switch block.\n";
} elsif (length $arg{context}) {
$return = "Break from the $arg{context}.\n";
my ($context) = $arg{context} =~ /([^|]+)/;
$return = "Break from the $context.\n";
} else {
$return = "Break from the current block.\n";
}
@ -395,7 +396,7 @@ expression_statement:
}
} else {
$return = $expression;
$return .= ".\n" unless $arg{context} =~ /for conditional$/;
$return .= ".\n" unless $arg{context} =~ /for (init|conditional)$/;
}
}