mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-19 10:29:30 +01:00
CGrammar: replace parameters
with arguments
where appropriate
This commit is contained in:
parent
8b626cc81e
commit
e1ed0bb6b9
@ -13,8 +13,8 @@ use warnings;
|
||||
# These are set automatically by the build/commit script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 700,
|
||||
BUILD_DATE => "2014-07-03",
|
||||
BUILD_REVISION => 701,
|
||||
BUILD_DATE => "2014-07-04",
|
||||
};
|
||||
|
||||
1;
|
||||
|
@ -389,14 +389,14 @@ close $fh;
|
||||
$output = `./c2eng.pl code2eng.c` if not defined $output;
|
||||
|
||||
if(not $has_function and not $has_main) {
|
||||
$output =~ s/Let .main. be a function taking no parameters and returning int.\s*To perform the function.\s*(return 0.)?//i;
|
||||
$output =~ s/Let .main. be a function taking no arguments and returning int.\s*To perform the function.\s*(return 0.)?//i;
|
||||
$output =~ s/\s*Return 0.\s*End of function .main..\s*//;
|
||||
$output =~ s/\s*Return 0.$//;
|
||||
$output =~ s/\s*Do nothing.\s*$//;
|
||||
$output =~ s/^\s*(.)/\U$1/;
|
||||
$output =~ s/\.\s+(\S)/. \U$1/g;
|
||||
} elsif($has_function and not $has_main) {
|
||||
$output =~ s/\s*Let `main` be a function taking no parameters and returning int.\s*To perform the function, return 0.//;
|
||||
$output =~ s/\s*Let `main` be a function taking no arguments and returning int.\s*To perform the function, return 0.//;
|
||||
}
|
||||
|
||||
$output =~ s/\s+/ /;
|
||||
|
@ -1317,10 +1317,10 @@ parameter_list:
|
||||
if (ref $parameter_list[$i] eq 'ARRAY') {
|
||||
my @list = ::flatten @{$parameter_list[$i]};
|
||||
if (@list == 0) {
|
||||
$return = "no parameters";
|
||||
$return = "no arguments";
|
||||
} elsif (@list == 1) {
|
||||
if ($list[0] eq 'void') {
|
||||
$return = "no parameters";
|
||||
$return = "no arguments";
|
||||
} else {
|
||||
$return .= $list[0];
|
||||
}
|
||||
@ -1350,11 +1350,11 @@ parameter_declaration:
|
||||
declaration_specifiers declarator
|
||||
{ $return = [$item{declaration_specifiers}, $item{declarator}]; }
|
||||
| '...'
|
||||
{ $return = "variadic parameters"; }
|
||||
{ $return = "variadic arguments"; }
|
||||
| declaration_specifiers abstract_declarator(?)
|
||||
{ $return = [$item{declaration_specifiers}, $item{'abstract_declarator(?)'}]; }
|
||||
| ''
|
||||
{ $return = "unspecified parameters"; }
|
||||
{ $return = "unspecified arguments"; }
|
||||
|
||||
abstract_declarator:
|
||||
pointer
|
||||
@ -1405,7 +1405,7 @@ direct_abstract_declarator:
|
||||
| DAD '[' ']'
|
||||
| DAD '[' array_qualifiers(?) assignment_expression(?) ']'
|
||||
| '(' ')'
|
||||
{ $return = 'function taking unspecified parameters and returning'; }
|
||||
{ $return = 'function taking unspecified arguments and returning'; }
|
||||
| '(' parameter_type_list ')'
|
||||
{ $return = "function taking $item{parameter_type_list} and returning"; }
|
||||
| DAD '(' ')'
|
||||
|
Loading…
Reference in New Issue
Block a user