Update Plang

This commit is contained in:
Pragmatic Software 2020-07-21 16:41:45 -07:00
parent 607890365c
commit 88262a2338
2 changed files with 5 additions and 5 deletions

2
Plang

@ -1 +1 @@
Subproject commit ac144eb83eb8a817742e9b25bca0d0ed218543fb
Subproject commit 82e771cd3bf5bcefec6241c66b56aa985884060e

View File

@ -103,7 +103,7 @@ sub cmd_plangrepl {
# overridden `print` built-in
sub print_override {
my ($self, $plang, $name, $arguments) = @_;
my ($self, $plang, $context, $name, $arguments) = @_;
my ($stmt, $end) = ($plang->output_value($arguments->[0]), $arguments->[1]->[1]);
$self->{output} .= "$stmt$end";
return ['NIL', undef];
@ -117,14 +117,14 @@ sub is_locked {
}
sub get_factoid {
my ($self, $plang, $name, $arguments) = @_;
my ($self, $plang, $context, $name, $arguments) = @_;
my ($namespace, $keyword, $meta) = ($arguments->[0]->[1], $arguments->[1]->[1], $arguments->[2]->[1]);
my $result = $self->{pbot}->{factoids}->get_meta($namespace, $keyword, $meta);
return ['STRING', $result];
}
sub set_factoid {
my ($self, $plang, $name, $arguments) = @_;
my ($self, $plang, $context, $name, $arguments) = @_;
my ($namespace, $keyword, $text) = ($arguments->[0]->[1], $arguments->[1]->[1], $arguments->[2]->[1]);
return ['ERROR', "Factoid $namespace.$keyword is locked. Cannot set."] if $self->is_locked($namespace, $keyword);
$self->{pbot}->{factoids}->add_factoid('text', $namespace, 'Plang', $keyword, $text);
@ -132,7 +132,7 @@ sub set_factoid {
}
sub append_factoid {
my ($self, $plang, $name, $arguments) = @_;
my ($self, $plang, $context, $name, $arguments) = @_;
my ($namespace, $keyword, $text) = ($arguments->[0]->[1], $arguments->[1]->[1], $arguments->[2]->[1]);
return ['ERROR', "Factoid $namespace.$keyword is locked. Cannot append."] if $self->is_locked($namespace, $keyword);
my $action = $self->{pbot}->{factoids}->get_meta($namespace, $keyword, 'action');