3
0
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:
Pragmatic Software 2010-04-29 18:58:05 +00:00
parent 0aeeedfaaa
commit 0c541f7a87
2 changed files with 2 additions and 4 deletions

View File

@ -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);

View File

@ -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);