| 1 | package Acme::Lambda::Expr::Placeholder; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use Carp (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | extends qw(Acme::Lambda::Expr::Term); | |||||||||
| 7 | |||||||||||
| 8 | 4 | has idx => ( | |||||||||
| 9 | is => 'ro', | ||||||||||
| 10 | isa => 'Int', | ||||||||||
| 11 | |||||||||||
| 12 | required => 1, | ||||||||||
| 13 | ); | ||||||||||
| 14 | |||||||||||
| 15 | 108 | ▶ | sub deparse{ | ||||||||
|
Subroutine
deparse: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 16 | 108 | my $self = shift; | |||||||||
| 17 | 108 | return sprintf '$_[%d]', $self->idx; | |||||||||
| 18 | } | ||||||||||
| 19 | 0 | ▶ | sub stringify{ | ||||||||
|
Subroutine
stringify: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 20 | 0 | my $self = shift; | |||||||||
| 21 | 0 | return sprintf 'placeholder(%d)', $self->idx; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 179 | ▶ | sub codify{ | ||||||||
|
Subroutine
codify: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 25 | 179 | my $self = shift; | |||||||||
| 26 | |||||||||||
| 27 | 179 | my $idx = $self->idx; | |||||||||
| 28 | |||||||||||
| 29 | 179 | ▶ | return sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||
| 30 | 179 | ▶ | Carp::confess('Not enough arguments for lambda') if @_ <= $idx; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 179 | return $_[$idx]; | |||||||||
| 32 | 179 | }; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | |||||||||||
| 36 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||