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

And arrays in the return value, for those that dont like using pointers

This commit is contained in:
Pragmatic Software 2010-05-06 23:44:43 +00:00
parent 63b8aae8dd
commit 31f0b129de
2 changed files with 2 additions and 2 deletions

View File

@ -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';

View File

@ -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';