3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 22:09:26 +01:00

Plugins/Plang: use output_value to print values

This commit is contained in:
Pragmatic Software 2020-07-15 21:47:03 -07:00
parent 1a2655c22d
commit 61dde5e9f5

View File

@ -63,7 +63,7 @@ sub cmd_plang {
my $result = $self->run($context->{arguments}); my $result = $self->run($context->{arguments});
# check to see if we need to append final result to output # check to see if we need to append final result to output
$self->{output} .= $result->[1] if defined $result->[1]; $self->{output} .= $self->{plang}->{interpreter}->output_value($result) if defined $result->[1];
# return the output # return the output
return length $self->{output} ? $self->{output} : "No output."; return length $self->{output} ? $self->{output} : "No output.";
@ -94,7 +94,7 @@ sub run {
my $program = $ast->[0]; my $program = $ast->[0];
my $statements = $program->[1]; my $statements = $program->[1];
my $result; # result of the final statement my $result; # result of the final statement
eval { eval {
# interpret the statements # interpret the statements