From 31f0b129de965db0fecb68c73bbafee206270ad0 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 6 May 2010 23:44:43 +0000 Subject: [PATCH] And arrays in the return value, for those that dont like using pointers --- modules/codepad.pl | 2 +- modules/ideone.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/codepad.pl b/modules/codepad.pl index a99fdaa9..5068672c 100755 --- a/modules/codepad.pl +++ b/modules/codepad.pl @@ -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'; diff --git a/modules/ideone.pl b/modules/ideone.pl index 33c967ae..03510a00 100755 --- a/modules/ideone.pl +++ b/modules/ideone.pl @@ -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';