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

CGrammar: Correct context for translation of "post-incremented" vs "increment by one"

This commit is contained in:
Pragmatic Software 2014-06-27 11:25:45 +00:00
parent 26e8f1552c
commit 3a3827fe40
2 changed files with 4 additions and 4 deletions

View File

@ -13,8 +13,8 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 680,
BUILD_DATE => "2014-06-26",
BUILD_REVISION => 681,
BUILD_DATE => "2014-06-27",
};
1;

View File

@ -965,7 +965,7 @@ postfix_productions:
{
my $increment = join('',@{$item[-1]});
if ($increment) {
if($arg{context} eq 'struct access' or $arg{context} eq 'for increment statement') {
if($arg{context} eq 'struct access' or $arg{context} =~ /statement/) {
$return = ['increment', 'by one'];
} else {
$return = "post-incremented $arg{primary_expression}";
@ -976,7 +976,7 @@ postfix_productions:
{
my $increment = join('',@{$item[-1]});
if ($increment) {
if($arg{context} eq 'struct access' or $arg{context} eq 'for increment statement') {
if($arg{context} eq 'struct access' or $arg{context} =~ /statement/) {
$return = ['decrement', 'by one'];
} else {
$return = "post-decremented $arg{primary_expression}";