3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

Update Plang submodule

This commit is contained in:
Pragmatic Software 2020-07-20 13:04:35 -07:00
parent b08f8f1cee
commit 9f2794abc3
2 changed files with 5 additions and 5 deletions

2
Plang

@ -1 +1 @@
Subproject commit 843f8e361c8d57193515db360f10104829acb2fc
Subproject commit c08e55ea9e7d7842d229d089b58ca0fc13240d4f

View File

@ -38,21 +38,21 @@ sub initialize {
$self->{plang} = Plang::Interpreter->new(embedded => 1, debug => $debug);
# register some PBot-specific built-in functions
$self->{plang}->{interpreter}->add_function_builtin('factset',
$self->{plang}->{interpreter}->add_builtin_function('factset',
# parameters are [['param1 name', default arg], ['param2 name', default arg], ...]
[['namespace', undef], ['keyword', undef], ['text', undef]],
sub { $self->set_factoid(@_) });
$self->{plang}->{interpreter}->add_function_builtin('factget',
$self->{plang}->{interpreter}->add_builtin_function('factget',
[['namespace', undef], ['keyword', undef], ['meta', ['STRING', 'action']]],
sub { $self->get_factoid(@_) });
$self->{plang}->{interpreter}->add_function_builtin('factappend',
$self->{plang}->{interpreter}->add_builtin_function('factappend',
[['namespace', undef], ['keyword', undef], ['text', undef]],
sub { $self->append_factoid(@_) });
# override the built-in `print` function to send to our output buffer instead
$self->{plang}->{interpreter}->add_function_builtin('print',
$self->{plang}->{interpreter}->add_builtin_function('print',
[['stmt', undef], ['end', ['STRING', "\n"]]],
sub { $self->print_override(@_) });