line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Translate::Fluent::Elements::Argument; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
41
|
use Moo; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
35
|
|
4
|
|
|
|
|
|
|
extends 'Translate::Fluent::Elements::Base'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has [qw( |
7
|
|
|
|
|
|
|
named_argument |
8
|
|
|
|
|
|
|
inline_expression |
9
|
|
|
|
|
|
|
)] => ( |
10
|
|
|
|
|
|
|
is => 'ro', |
11
|
|
|
|
|
|
|
default => sub { undef }, |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
around BUILDARGS => sub { |
15
|
|
|
|
|
|
|
my ($orig, $class, %args) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$args{named_argument} = delete $args{ NamedArgument }; |
18
|
|
|
|
|
|
|
$args{inline_expression} = delete $args{ InlineExpression }; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$class->$orig( %args ); |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub identifier { |
24
|
15
|
|
|
15
|
1
|
23
|
my ($self) = @_; |
25
|
|
|
|
|
|
|
|
26
|
15
|
100
|
|
|
|
37
|
if ($self->named_argument) { |
27
|
12
|
|
|
|
|
40
|
return $self->named_argument->identifier; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
|
|
8
|
return; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub translate { |
34
|
15
|
|
|
15
|
1
|
27
|
my ($self, $variables) = @_; |
35
|
|
|
|
|
|
|
|
36
|
15
|
100
|
|
|
|
41
|
if ($self->named_argument) { |
|
|
50
|
|
|
|
|
|
37
|
12
|
|
|
|
|
31
|
return $self->named_argument->translate( $variables ); |
38
|
|
|
|
|
|
|
} elsif ($self->inline_expression) { |
39
|
3
|
|
|
|
|
16
|
return $self->inline_expression->translate( $variables ); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
return; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |