line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Articulate::Augmentation::Interpreter; |
2
|
1
|
|
|
1
|
|
1644
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
47
|
|
3
|
1
|
|
|
1
|
|
18
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
3
|
use Moo; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
280
|
use Articulate::Syntax qw(instantiate instantiate_array); |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has default_format => ( is => 'rw', ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has interpreters => ( |
11
|
|
|
|
|
|
|
is => 'rw', |
12
|
|
|
|
|
|
|
default => sub { {} }, |
13
|
|
|
|
|
|
|
coerce => sub { |
14
|
|
|
|
|
|
|
my $interpreters = shift; |
15
|
|
|
|
|
|
|
foreach my $type ( keys %$interpreters ) { |
16
|
|
|
|
|
|
|
$interpreters->{$type} = instantiate_array( $interpreters->{$type} ); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
return $interpreters; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub augment { |
23
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
24
|
0
|
|
|
|
|
|
my $item = shift; |
25
|
0
|
|
|
|
|
|
my $format = $self->default_format; |
26
|
0
|
|
|
|
|
|
foreach my $f ( keys %{ $self->interpreters } ) { |
|
0
|
|
|
|
|
|
|
27
|
0
|
0
|
0
|
|
|
|
if ( ( $item->meta->{schema}->{core}->{format} // '' ) eq $f ) { |
28
|
0
|
|
|
|
|
|
$format = $f; |
29
|
0
|
|
|
|
|
|
last; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
|
foreach my $interpreter ( @{ $self->interpreters->{$format} } ) { |
|
0
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
$interpreter->augment($item); |
34
|
|
|
|
|
|
|
} |
35
|
0
|
|
|
|
|
|
return $item; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |