mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 04:19:27 +01:00
compiler_vm improvements
Server-side C base now strips print_last_statement() and rebuilds/re-runs code if there was any bad gdb output related to it (i.e. "No such symbol" or "A syntax error in expression").
This commit is contained in:
parent
76fc3a33a1
commit
ef3b8f0fbc
@ -41,9 +41,17 @@ sub postprocess {
|
|||||||
|
|
||||||
$result =~ s/\s+$//;
|
$result =~ s/\s+$//;
|
||||||
|
|
||||||
$self->{no_output} = 1 if not length $result;
|
if (not length $result) {
|
||||||
|
$self->{no_output} = 1;
|
||||||
$self->{output} .= $result;
|
} elsif ($self->{code} =~ m/print_last_statement\(.*\);$/m
|
||||||
|
&& ($result =~ m/A syntax error in expression/ || $result =~ m/No symbol.*in current context/)) {
|
||||||
|
# strip print_last_statement and rebuild/re-run
|
||||||
|
$self->{code} =~ s/print_last_statement\((.*)\);/$1;/mg;
|
||||||
|
$self->preprocess;
|
||||||
|
$self->postprocess;
|
||||||
|
} else {
|
||||||
|
$self->{output} .= $result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user