mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-23 11:12:42 +01:00
And arrays in the return value, for those that dont like using pointers
This commit is contained in:
parent
63b8aae8dd
commit
31f0b129de
@ -65,7 +65,7 @@ if($lang eq "C" or $lang eq "C++") {
|
||||
my $prelude = '';
|
||||
$prelude = "$1$2" if $precode =~ s/^\s*(#.*)(#.*?[>\n])//s;
|
||||
|
||||
while($precode =~ s/([a-zA-Z0-9_*]+)\s+([a-zA-Z0-9_*]+)\s*\((.*?)\)\s*{(.*?)}//) {
|
||||
while($precode =~ s/([a-zA-Z0-9_*\[\]]+)\s+([a-zA-Z0-9_*]+)\s*\((.*?)\)\s*{(.*?)}//) {
|
||||
my ($ret, $ident, $params, $body) = ($1, $2, $3, $4);
|
||||
$code .= "$ret $ident($params) { $body }\n\n";
|
||||
$has_main = 1 if $ident eq 'main';
|
||||
|
@ -134,7 +134,7 @@ if($languages{$lang}{'id'} == 1 or $languages{$lang}{'id'} == 11 or $languages{$
|
||||
my $prelude = '';
|
||||
$prelude = "$1$2" if $precode =~ s/^\s*(#.*)(#.*?[>\n])//s;
|
||||
|
||||
while($precode =~ s/([a-zA-Z0-9_*]+)\s+([a-zA-Z0-9_*]+)\s*\((.*?)\)\s*{(.*?)}//) {
|
||||
while($precode =~ s/([a-zA-Z0-9_*\[\]]+)\s+([a-zA-Z0-9_*]+)\s*\((.*?)\)\s*{(.*?)}//) {
|
||||
my ($ret, $ident, $params, $body) = ($1, $2, $3, $4);
|
||||
$code .= "$ret $ident($params) { $body }\n\n";
|
||||
$has_main = 1 if $ident eq 'main';
|
||||
|
Loading…
Reference in New Issue
Block a user