Skip to content

Commit

Permalink
Implement hard indirect method calls
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Dec 27, 2010
1 parent 0dc0b89 commit 92aafcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Niecza/Actions.pm
Expand Up @@ -1349,6 +1349,10 @@ sub POSTFIX { my ($cl, $M) = @_;
ppath => $op->{path},
name => $op->{name},
args => $op->{args} // []);
} elsif ($op->{ref}) { # $obj.&foo
$M->{_ast} = Op::CallSub->new(node($M),
invocant => $op->{ref},
args => [ $arg, @{ $op->{args} // [] } ]);
} elsif ($op->{postcall}) {
if (@{ $op->{postcall} } > 1) {
$M->sorry("Slicels NYI");
Expand All @@ -1366,6 +1370,7 @@ sub POSTFIX { my ($cl, $M) = @_;
}
} else {
say join(" ", %$M);
say(YAML::XS::Dump($op));
$M->sorry("Unhandled postop type");
}
$M->{_ast} = $cl->whatever_postcheck($M, $st, $M->{_ast});
Expand Down
2 changes: 2 additions & 0 deletions test2.pl
Expand Up @@ -11,6 +11,8 @@
my $f = Any; $f andthen= 4; is $f, Any, 'andthen= works (U)';
my $g = 0; $g //= 4; is $g, 0, '//= works (D)';
my $h = Any; $h //= 4; is $h, 4, '//= works (U)';

is 2.&not, False, '.& notation works';
}

{
Expand Down

0 comments on commit 92aafcb

Please sign in to comment.