3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-25 04:02:37 +01:00

CGrammar: Remove excessive "result of the expression" for parenthesized expressions

This commit is contained in:
Pragmatic Software 2014-09-09 07:20:42 +00:00
parent 83af062376
commit 2529d49aac
2 changed files with 5 additions and 4 deletions

View File

@ -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 => 784, BUILD_REVISION => 785,
BUILD_DATE => "2014-09-09", BUILD_DATE => "2014-09-09",
}; };

View File

@ -629,6 +629,7 @@ logical_OR_AND_expression:
and $expression !~ /^the .*? number \S+$/i and $expression !~ /^the .*? number \S+$/i
and $expression !~ /the size of/i and $expression !~ /the size of/i
and $expression !~ /the offset/i and $expression !~ /the offset/i
and $expression !~ /the address of/i
and $expression !~ /^the result of the/) { and $expression !~ /^the result of the/) {
$return = 'the result of the expression ^L'; $return = 'the result of the expression ^L';
} }
@ -961,7 +962,7 @@ designator:
} }
$expression = "the $expression element"; $expression = "the $expression element";
} else { } else {
$expression = "the element at location $expression"; $expression = "the element at location ^L$expression^L";
} }
$return = $expression; $return = $expression;
@ -1112,7 +1113,7 @@ postfix_productions:
my $plural = $expression == 1 ? '' : 's'; my $plural = $expression == 1 ? '' : 's';
$return = "the location $expression element$plural backwards from where ^L$arg{primary_expression} points^L"; $return = "the location $expression element$plural backwards from where ^L$arg{primary_expression} points^L";
} else { } else {
$return = "the element at location ^L$expression^L of"; $return = "the element at location ^L$expression of^L";
$return .= " $arg{primary_expression}" if $arg{primary_expression}; $return .= " $arg{primary_expression}" if $arg{primary_expression};
} }
} }
@ -1288,7 +1289,7 @@ primary_expression:
if ($arg{context} =~ /statement$/) { if ($arg{context} =~ /statement$/) {
$return = "Evaluate the expression "; $return = "Evaluate the expression ";
} else { } else {
$return = "The result of the expression "; #$return = "The result of the expression ";
} }
$return .= '(' x $repeats; $return .= '(' x $repeats;
$return .= "^L$expression"; $return .= "^L$expression";