From 6006edafaed5a23de09eed93b52f853e9dc765da Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 25 Apr 2010 23:24:47 +0000 Subject: [PATCH] Better output --- modules/codepad.pl | 8 +++----- modules/ideone.pl | 10 ++++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/codepad.pl b/modules/codepad.pl index 24a14a70..667fd339 100755 --- a/modules/codepad.pl +++ b/modules/codepad.pl @@ -83,16 +83,14 @@ if($text =~ /Output:<\/span>.+?
(.*)<\/di $output = decode_entities($output); $output = HTML::FormatText->new->format(parse_html($output)); -$output =~ s/[\n\r]/ /g; -$output =~ s/\s+/ /g; -$output =~ s/^\s+//g; -$output =~ s/\s+$//g; +$output =~ s/^\s+//; $output =~ s/ Line \d+ ://g; $output =~ s/ \(first use in this function\)//g; $output =~ s/error: \(Each undeclared identifier is reported only once.*?\)//g; -$output =~ s/error: (.*?) error/error: $1; error/g; +$output =~ s/error: (.*?).error/error: $1; error/g; +print FILE localtime . "\n"; print FILE "$nick: [ $url ] $output\n\n"; close FILE; print "$nick: $output\n"; diff --git a/modules/ideone.pl b/modules/ideone.pl index b5bdb1ec..bffa5ab1 100755 --- a/modules/ideone.pl +++ b/modules/ideone.pl @@ -12,6 +12,9 @@ my $result; my %languages = ( 'Ada' => { 'id' => '7', 'name' => 'Ada (gnat-4.3.2)' }, + 'asm' => { 'id' => '13', 'name' => 'Assembler (nasm-2.07)' }, + 'nasm' => { 'id' => '13', 'name' => 'Assembler (nasm-2.07)' }, + 'Assembler' => { 'id' => '13', 'name' => 'Assembler (nasm-2.07)' }, 'Assembler' => { 'id' => '13', 'name' => 'Assembler (nasm-2.07)' }, 'gawk' => { 'id' => '104', 'name' => 'AWK (gawk) (gawk-3.1.6)' }, 'mawk' => { 'id' => '105', 'name' => 'AWK (mawk) (mawk-1.3.3)' }, @@ -138,10 +141,10 @@ my $MEMORYLIMIT = 17; my $ILLEGAL_SYSCALL = 19; my $INTERNAL_ERROR = 20; -if($result->{result} == $COMPILER_ERROR) { +#if($result->{result} == $COMPILER_ERROR) { $output .= $result->{cmpinfo}; $output =~ s/[\n\r]/ /g; -} +#} if($result->{signal}) { $output .= "\n[Signal: $result->{signal}]"; @@ -177,6 +180,9 @@ $output =~ s/error: \(Each undeclared identifier is reported only once.*?\)//msg $output =~ s/prog\.c[:\d\s]*//g; $output =~ s/error: (.*?) error/error: $1; error/msg; +$output = "No output." if $output =~ m/^\s+$/; + +print FILE localtime . "\n"; print FILE "$nick: [ http://ideone.com/$url ] $output\n\n"; close FILE; print "$nick: $output\n";