mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 02:49:49 +01:00
Update Plang submodule
This commit is contained in:
parent
b08f8f1cee
commit
9f2794abc3
2
Plang
2
Plang
@ -1 +1 @@
|
||||
Subproject commit 843f8e361c8d57193515db360f10104829acb2fc
|
||||
Subproject commit c08e55ea9e7d7842d229d089b58ca0fc13240d4f
|
@ -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(@_) });
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user