mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-22 20:09:43 +01:00
pbot-vm: rebuild without print_last_statement() if "cannot subscript something" error
This commit is contained in:
parent
4b5d8aa535
commit
e7f4729567
@ -112,7 +112,14 @@ sub postprocess {
|
|||||||
if (not length $result) {
|
if (not length $result) {
|
||||||
$self->{no_output} = 1;
|
$self->{no_output} = 1;
|
||||||
} elsif ($self->{code} =~ m/print_last_statement\(.*\);$/m
|
} elsif ($self->{code} =~ m/print_last_statement\(.*\);$/m
|
||||||
&& ($result =~ m/A syntax error in expression/ || $result =~ m/No symbol.*in current context/ || $result =~ m/has unknown return type; cast the call to its declared return/ || $result =~ m/Can't take address of.*which isn't an lvalue/)) {
|
&& (
|
||||||
|
# should move this into its own function with a list
|
||||||
|
$result =~ m/A syntax error in expression/
|
||||||
|
|| $result =~ m/No symbol.*in current context/
|
||||||
|
|| $result =~ m/has unknown return type; cast the call to its declared return/
|
||||||
|
|| $result =~ m/Can't take address of.*which isn't an lvalue/
|
||||||
|
|| $result =~ m/cannot subscript something/
|
||||||
|
)) {
|
||||||
# strip print_last_statement and rebuild/re-run
|
# strip print_last_statement and rebuild/re-run
|
||||||
$self->{code} =~ s/print_last_statement\((.*)\);/$1;/mg;
|
$self->{code} =~ s/print_last_statement\((.*)\);/$1;/mg;
|
||||||
$self->preprocess;
|
$self->preprocess;
|
||||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
|||||||
# These are set by the /misc/update_version script
|
# These are set by the /misc/update_version script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 4533,
|
BUILD_REVISION => 4534,
|
||||||
BUILD_DATE => "2022-04-08",
|
BUILD_DATE => "2022-05-01",
|
||||||
};
|
};
|
||||||
|
|
||||||
sub initialize {}
|
sub initialize {}
|
||||||
|
Loading…
Reference in New Issue
Block a user