mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-23 19:22:40 +01:00
Make c2english output slightly more clean
This commit is contained in:
parent
c6e67200c1
commit
111847340e
@ -13,7 +13,7 @@ use warnings;
|
|||||||
# These are set automatically by the build/commit script
|
# These are set automatically by the build/commit script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 454,
|
BUILD_REVISION => 455,
|
||||||
BUILD_DATE => "2013-10-19",
|
BUILD_DATE => "2013-10-19",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ open my $fh, '>', 'code.c' or die "Could not write code: $!";
|
|||||||
print $fh $code;
|
print $fh $code;
|
||||||
close $fh;
|
close $fh;
|
||||||
|
|
||||||
my ($ret, $result) = execute(10, "gcc -std=c89 -pedantic -Werror -Wno-unused -c code.c");
|
my ($ret, $result) = execute(10, "gcc -std=c89 -pedantic -Werror -Wno-unused -fsyntax-only -fno-diagnostics-show-option code.c");
|
||||||
|
|
||||||
if($ret != 0) {
|
if($ret != 0) {
|
||||||
$output = $result;
|
$output = $result;
|
||||||
@ -128,6 +128,7 @@ if($ret != 0) {
|
|||||||
$output =~ s/<'(.*)' = char>/<'$1' = int>/g;
|
$output =~ s/<'(.*)' = char>/<'$1' = int>/g;
|
||||||
$output =~ s/= (-?\d+) ''/= $1/g;
|
$output =~ s/= (-?\d+) ''/= $1/g;
|
||||||
$output =~ s/, <incomplete sequence >//g;
|
$output =~ s/, <incomplete sequence >//g;
|
||||||
|
$output =~ s/\s*error: expected ';' before 'return'//g;
|
||||||
|
|
||||||
print "$output\n";
|
print "$output\n";
|
||||||
exit 0;
|
exit 0;
|
||||||
@ -154,7 +155,8 @@ $output =~ s/to an integer/to int/g;
|
|||||||
$output =~ s/with no arguments returning/with unspecified arguments returning/g;
|
$output =~ s/with no arguments returning/with unspecified arguments returning/g;
|
||||||
$output =~ s/with argument a void/with no arguments/g;
|
$output =~ s/with argument a void/with no arguments/g;
|
||||||
$output =~ s/\s*After that,\s*$//;
|
$output =~ s/\s*After that,\s*$//;
|
||||||
$output =~s/as long as zero does not equal 1/while the condition is true/g;
|
$output =~ s/as long as zero does not equal 1/while the condition is true/g;
|
||||||
|
$output =~ s/\ncompute nothing.//g;
|
||||||
|
|
||||||
$output =~ s/\s+/ /;
|
$output =~ s/\s+/ /;
|
||||||
if($output eq " ") {
|
if($output eq " ") {
|
||||||
|
Loading…
Reference in New Issue
Block a user