mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 22:09:26 +01:00
Make extra semi-colon more identifible as to not replace inside for(;;) or other cases
This commit is contained in:
parent
271839b71f
commit
0aeeedfaaa
@ -60,10 +60,10 @@ $code = $preludes{$lang} . $code;
|
|||||||
if(($lang eq "C" or $lang eq "C++") and not $code =~ m/(int|void) main\s*\([^)]*\)\s*{/) {
|
if(($lang eq "C" or $lang eq "C++") and not $code =~ m/(int|void) main\s*\([^)]*\)\s*{/) {
|
||||||
my $prelude = '';
|
my $prelude = '';
|
||||||
$prelude = "$1$2" if $code =~ s/^\s*(#.*)(#.*?[>\n])//s;
|
$prelude = "$1$2" if $code =~ s/^\s*(#.*)(#.*?[>\n])//s;
|
||||||
$code = "$prelude\n\nint main(int argc, char **argv) { $code ; return 0; }";
|
$code = "$prelude\n\nint main(int argc, char **argv) { $code;/**/ return 0; }";
|
||||||
|
$code =~ s/;\s*;\/\*\*\//;/g;
|
||||||
}
|
}
|
||||||
|
|
||||||
$code =~ s/;\s*;/;/g;
|
|
||||||
$code = pretty($code);
|
$code = pretty($code);
|
||||||
|
|
||||||
my %post = ( 'lang' => $lang, 'code' => $code, 'private' => 'True', 'run' => 'True', 'submit' => 'Submit' );
|
my %post = ( 'lang' => $lang, 'code' => $code, 'private' => 'True', 'run' => 'True', 'submit' => 'Submit' );
|
||||||
|
@ -128,10 +128,10 @@ if(($languages{$lang}{'id'} == 1 or $languages{$lang}{'id'} == 11 or $languages{
|
|||||||
my $prelude = '';
|
my $prelude = '';
|
||||||
$prelude = "$1$2" if $code =~ s/^\s*(#.*)(#.*?[>\n])//s;
|
$prelude = "$1$2" if $code =~ s/^\s*(#.*)(#.*?[>\n])//s;
|
||||||
$code =~ s/^\s+//;
|
$code =~ s/^\s+//;
|
||||||
$code = "$prelude\n\nint main(int argc, char **argv) { $code; return 0;}\n";
|
$code = "$prelude\n\nint main(int argc, char **argv) { $code;/**/ return 0;}\n";
|
||||||
|
$code =~ s/;\s*;\/\*\*\//;/g;
|
||||||
}
|
}
|
||||||
|
|
||||||
$code =~ s/;\s*;/;/g;
|
|
||||||
$code = pretty($code);
|
$code = pretty($code);
|
||||||
|
|
||||||
$code =~ s/\\n/\n/g if $languages{$lang}{'id'} == 13 or $languages{$lang}{'id'} == 101;
|
$code =~ s/\\n/\n/g if $languages{$lang}{'id'} == 13 or $languages{$lang}{'id'} == 101;
|
||||||
|
Loading…
Reference in New Issue
Block a user