3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 03:02:47 +01:00

compiler_vm: -paste and -nomain arguments no longer need to be first arguments; fix issue with replace command

This commit is contained in:
Pragmatic Software 2013-09-13 09:29:24 +00:00
parent a6a3129171
commit 8d882a4240
2 changed files with 7 additions and 6 deletions

View File

@ -13,8 +13,8 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 427,
BUILD_DATE => "2013-08-27",
BUILD_REVISION => 428,
BUILD_DATE => "2013-09-13",
};
1;

View File

@ -154,10 +154,10 @@ my $input = "";
$input = $1 if $code =~ s/-(?:input|stdin)=(.*)$//i;
my $got_paste = undef;
$got_paste = 1 if $code =~ s/\s*-paste\s*//i;
$got_paste = 1 if $code =~ s/(?<=\s)*-paste\s*//i;
my $got_nomain = undef;
$got_nomain = 1 if $code =~ s/\s*-nomain\s*//i;
$got_nomain = 1 if $code =~ s/(?<=\s)*-nomain\s*//i;
my $args = "";
$args .= "$1 " while $code =~ s/^\s*(-[^ ]+)\s*//;
@ -321,7 +321,7 @@ if($code =~ m/^\s*(run|paste)\s*$/i) {
next;
}
if($subcode =~ m/^\s*(and)?\s*replace\s*([^']+)?\s*'.*'\s*with\s*'.*'/i) {
if($subcode =~ m/^\s*(and)?\s*replace\s*([^']+)?\s*'.*'\s*with\s*'.*?'/i) {
$got_sub = 1;
my $modifier = 'first';
@ -569,7 +569,7 @@ if($code =~ m/^\s*(run|paste)\s*$/i) {
$previous_modifier = $modifier;
}
if($got_sub and not $got_changes) {
if(not $got_changes) {
print "$nick: No replacements made.\n";
exit 0;
}
@ -961,6 +961,7 @@ if($output =~ m/^\s*$/) {
$output =~ s/<No symbol table is loaded. Use the "file" command.>\s*//g;
$output =~ s/cc1: all warnings being treated as; errors//g;
$output =~ s/, note: this is the location of the previous definition//g;
$output =~ s/ called by gdb \(\) at statement: void gdb\(\) { __asm__\(""\); }//;
# remove duplicate warnings/infos
$output =~ s/(\[*.*warning:.*?\s*)\1/$1/g;