line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Articulate::Augmentation::Interpreter;
|
2
|
1
|
|
|
1
|
|
2709
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
65
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use Moo;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
254
|
use Articulate::Syntax qw(instantiate instantiate_array);
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has default_format =>
|
9
|
|
|
|
|
|
|
is => 'rw';
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has interpreters =>
|
12
|
|
|
|
|
|
|
is => 'rw',
|
13
|
|
|
|
|
|
|
default => sub { {} },
|
14
|
|
|
|
|
|
|
coerce => sub {
|
15
|
|
|
|
|
|
|
my $interpreters = shift;
|
16
|
|
|
|
|
|
|
foreach my $type (keys %$interpreters){
|
17
|
|
|
|
|
|
|
$interpreters->{$type} = instantiate_array( $interpreters->{$type} );
|
18
|
|
|
|
|
|
|
}
|
19
|
|
|
|
|
|
|
return $interpreters;
|
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;
|