mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-23 03:02:47 +01:00
Forget about ;/**/ sequence -- just require code to have semi-colon
This commit is contained in:
parent
0aeeedfaaa
commit
0c541f7a87
@ -60,8 +60,7 @@ $code = $preludes{$lang} . $code;
|
||||
if(($lang eq "C" or $lang eq "C++") and not $code =~ m/(int|void) main\s*\([^)]*\)\s*{/) {
|
||||
my $prelude = '';
|
||||
$prelude = "$1$2" if $code =~ s/^\s*(#.*)(#.*?[>\n])//s;
|
||||
$code = "$prelude\n\nint main(int argc, char **argv) { $code;/**/ return 0; }";
|
||||
$code =~ s/;\s*;\/\*\*\//;/g;
|
||||
$code = "$prelude\n\nint main(int argc, char **argv) { $code return 0; }";
|
||||
}
|
||||
|
||||
$code = pretty($code);
|
||||
|
@ -128,8 +128,7 @@ if(($languages{$lang}{'id'} == 1 or $languages{$lang}{'id'} == 11 or $languages{
|
||||
my $prelude = '';
|
||||
$prelude = "$1$2" if $code =~ s/^\s*(#.*)(#.*?[>\n])//s;
|
||||
$code =~ s/^\s+//;
|
||||
$code = "$prelude\n\nint main(int argc, char **argv) { $code;/**/ return 0;}\n";
|
||||
$code =~ s/;\s*;\/\*\*\//;/g;
|
||||
$code = "$prelude\n\nint main(int argc, char **argv) { $code return 0;}\n";
|
||||
}
|
||||
|
||||
$code = pretty($code);
|
||||
|
Loading…
Reference in New Issue
Block a user