3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-01 17:16:39 +02:00

CGrammar: Fix passing 0 as argument to function

This commit is contained in:
Pragmatic Software 2014-07-10 12:35:33 +00:00
parent 5f9fb29e7e
commit 38b6edf656
3 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
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 724,
BUILD_REVISION => 725,
BUILD_DATE => "2014-07-10",
};

View File

@ -266,7 +266,7 @@ iteration_statement:
$return .= "Repeatedly ^L";
}
$return .= "$item{statement}.";
$return .= "$item{statement}.\n";
if ($increment) {
$return =~ s/End for loop.$//;
@ -1015,7 +1015,7 @@ postfix_productions:
}
my $arg_exp_list = join('',@{$item{'argument_expression_list(?)'}});
if ($arg_exp_list) {
if (length $arg_exp_list) {
$return .= " with argument$arg_exp_list";
}
@ -1214,7 +1214,7 @@ argument_expression_list:
} elsif (@arg_exp_list == 2 ) {
$return = "s ^L$arg_exp_list[0] and ^L$arg_exp_list[1]";
} else {
if ($arg_exp_list[0]) {
if (length $arg_exp_list[0]) {
$return = " ^L$arg_exp_list[0]";
} else {
$return = '';

View File

@ -75,6 +75,7 @@ foreach my $arg (@ARGV) {
$output =~ s/the evaluate the/the/g;
$output =~ s/by evaluate the/by the/g;
$output =~ s/the a /the /g;
$output =~ s/result of the expression the result of the function/result of the function/g;
foreach my $quote (@quotes) {
next unless $quote;