mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-17 05:50:56 +01:00
CGrammar: Fix for loop init and break statement
This commit is contained in:
parent
a59cc20128
commit
7f293450ef
@ -13,7 +13,7 @@ use warnings;
|
|||||||
# These are set automatically by the build/commit script
|
# These are set automatically by the build/commit script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 737,
|
BUILD_REVISION => 738,
|
||||||
BUILD_DATE => "2014-07-17",
|
BUILD_DATE => "2014-07-17",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -358,7 +358,8 @@ jump_statement:
|
|||||||
if ($arg{context} =~ /switch/ or $arg{context} =~ /case/) {
|
if ($arg{context} =~ /switch/ or $arg{context} =~ /case/) {
|
||||||
$return = "Exit switch block.\n";
|
$return = "Exit switch block.\n";
|
||||||
} elsif (length $arg{context}) {
|
} elsif (length $arg{context}) {
|
||||||
$return = "Break from the $arg{context}.\n";
|
my ($context) = $arg{context} =~ /([^|]+)/;
|
||||||
|
$return = "Break from the $context.\n";
|
||||||
} else {
|
} else {
|
||||||
$return = "Break from the current block.\n";
|
$return = "Break from the current block.\n";
|
||||||
}
|
}
|
||||||
@ -395,7 +396,7 @@ expression_statement:
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$return = $expression;
|
$return = $expression;
|
||||||
$return .= ".\n" unless $arg{context} =~ /for conditional$/;
|
$return .= ".\n" unless $arg{context} =~ /for (init|conditional)$/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user