From a6a2b3eeb3366fd49b4b5432be2d4e361ad8b957 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 19 Nov 2012 15:45:13 +0000 Subject: [PATCH] Minor clean-up of previous commit to remove unnecessary substitutions --- PBot/VERSION.pm | 4 ++-- modules/compiler_vm/compiler_vm_client.pl | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 909546fd..4389429f 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,8 +13,8 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 394, - BUILD_DATE => "2012-11-18", + BUILD_REVISION => 395, + BUILD_DATE => "2012-11-19", }; 1; diff --git a/modules/compiler_vm/compiler_vm_client.pl b/modules/compiler_vm/compiler_vm_client.pl index 2ab890ea..3ec9840c 100755 --- a/modules/compiler_vm/compiler_vm_client.pl +++ b/modules/compiler_vm/compiler_vm_client.pl @@ -751,12 +751,11 @@ if($lang eq 'C' or $lang eq 'C99' or $lang eq 'C11' or $lang eq 'C++') { print "looking for functions, has main: $has_main\n" if $debug >= 2; - my $func_regex = qr/^([ a-zA-Z0-9_*]+)\s+([a-zA-Z0-9_*]+)\s*\(([^{]*)\s*({.*)/ms; + my $func_regex = qr/^([ A-Z0-9_*]+)\s+([A-Z0-9_*]+)\s*\((.*?)\s*\)\s*({.*)/ims; # look for potential functions to extract while($preprecode =~ /$func_regex/ms) { my ($pre_ret, $pre_ident, $pre_params, $pre_potential_body) = ($1, $2, $3, $4); - $pre_params =~ s/\)\s*$//; print "looking for functions, found [$pre_ret][$pre_ident][$pre_params][$pre_potential_body], has main: $has_main\n" if $debug >= 1; @@ -776,7 +775,6 @@ if($lang eq 'C' or $lang eq 'C99' or $lang eq 'C11' or $lang eq 'C++') { $tmpcode =~ m/$func_regex/ms; my ($ret, $ident, $params, $potential_body) = ($1, $2, $3, $4); - $params =~ s/\)\s*$//; print "1st extract: [$ret][$ident][$params][$potential_body]\n" if $debug;