Skip to content

Commit

Permalink
Implement postfix operators
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan O'Rear committed Jul 13, 2010
1 parent eba37ef commit b1b78bb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Niecza/Actions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ sub CHAIN { my ($cl, $M) = @_;
positionals => [ $M->{chain}[0]{_ast}, $M->{chain}[2]{_ast} ]);
}

sub POSTFIX { my ($cl, $M) = @_;
$M->{_ast} = Op::CallSub->new(
invocant => Op::Lexical->new(name => '&postfix:<' . $M->{sym} . '>'),
positionals => [ $M->{arg}{_ast} ]);
}

# infix et al just parse the operator itself
sub infix { }
sub infix__S_ANY { }
Expand All @@ -210,6 +216,11 @@ sub prefix__S_ANY { }
sub postfix { }
sub postfix__S_ANY { }

sub postcircumfix { }

sub postop { }
sub POST { }

sub coloncircumfix { my ($cl, $M) = @_;
$M->{_ast} = $M->{circumfix}{_ast};
$M->{qpvalue} = $M->{circumfix}{qpvalue};
Expand Down

0 comments on commit b1b78bb

Please sign in to comment.