mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 04:19:27 +01:00
Plugins/Plang: print() takes an expr, not a stmt
This commit is contained in:
parent
ee5d5934fe
commit
58e75682b1
@ -53,7 +53,7 @@ sub initialize {
|
||||
|
||||
# override the built-in `print` function to send to our output buffer instead
|
||||
$self->{plang}->{interpreter}->add_builtin_function('print',
|
||||
[['stmt', undef], ['end', ['STRING', "\n"]]],
|
||||
[['expr', undef], ['end', ['STRING', "\n"]]],
|
||||
sub { $self->print_override(@_) });
|
||||
|
||||
# register the `plang` command
|
||||
@ -104,8 +104,8 @@ sub cmd_plangrepl {
|
||||
|
||||
sub print_override {
|
||||
my ($self, $plang, $context, $name, $arguments) = @_;
|
||||
my ($stmt, $end) = ($plang->output_value($arguments->[0]), $arguments->[1]->[1]);
|
||||
$self->{output} .= "$stmt$end";
|
||||
my ($expr, $end) = ($plang->output_value($arguments->[0]), $arguments->[1]->[1]);
|
||||
$self->{output} .= "$expr$end";
|
||||
return ['NIL', undef];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user