line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Translate::Fluent::Elements::NamedArgument; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
39
|
use Moo; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
33
|
|
4
|
|
|
|
|
|
|
extends 'Translate::Fluent::Elements::Base'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has [qw( |
7
|
|
|
|
|
|
|
identifier |
8
|
|
|
|
|
|
|
string_literal |
9
|
|
|
|
|
|
|
number_literal |
10
|
|
|
|
|
|
|
)] => ( |
11
|
|
|
|
|
|
|
is => 'ro', |
12
|
|
|
|
|
|
|
default => sub { undef }, |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
around BUILDARGS => sub { |
16
|
|
|
|
|
|
|
my ($orig, $class, %args) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$args{identifier} = delete $args{ Identifier }; |
19
|
|
|
|
|
|
|
$args{string_literal} = delete $args{ StringLiteral }; |
20
|
|
|
|
|
|
|
$args{number_literal} = delete $args{ NumberLiteral }; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$class->$orig( %args ); |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub translate { |
26
|
12
|
|
|
12
|
1
|
19
|
my ($self) = @_; |
27
|
|
|
|
|
|
|
|
28
|
12
|
|
66
|
|
|
39
|
my $part = $self->string_literal |
29
|
|
|
|
|
|
|
// $self->number_literal; |
30
|
|
|
|
|
|
|
|
31
|
12
|
100
|
|
|
|
48
|
return ref $part ? $part->translate : $part; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
__END__ |