| 1 | 50 | ▶ | use v5.14; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 2 | 50 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||
| 4 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | Attean::API::Parser - Parser role | ||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | This document describes Attean::API::Parser version 0.040 | ||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | The Attean::API::Parser role defines a common API for all parsers of typed | ||||||||||||||||||||||||||||||||||||||||||
| 15 | objects from data (either a byte string or a filehandle). | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | =head1 ATTRIBUTES | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | The following attributes exist: | ||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | =over 4 | ||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | =item C<< handler >> | ||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | A code reference that will be called during callback-variant parsing methods. | ||||||||||||||||||||||||||||||||||||||||||
| 26 | This attribute has a default (no-op function), so specifying it is not | ||||||||||||||||||||||||||||||||||||||||||
| 27 | necessary if using iterator- or list-variant parsing methods. | ||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | =back | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | =head1 REQUIRED METHODS | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | The following methods are required by the L<Attean::API::Parser> role: | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | =over 4 | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | =item C<< canonical_media_type >> | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | Returns the canonical media type string for the format of this parser. | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | =item C<< media_types >> | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | Returns an ARRAY reference of media type strings that are acceptable as input | ||||||||||||||||||||||||||||||||||||||||||
| 44 | to this parser. | ||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | =item C<< handled_type >> | ||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | Returns a L<Type::Tiny> object representing the type of items that result from | ||||||||||||||||||||||||||||||||||||||||||
| 49 | parsing. | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | =item C<< file_extensions >> | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | Returns an ARRAY reference of file extensions commonly associated with the | ||||||||||||||||||||||||||||||||||||||||||
| 54 | media types supported by the parser (and returned by C<< media_types >>). | ||||||||||||||||||||||||||||||||||||||||||
| 55 | File extensions should NOT include a leading dot. | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | 50 | ▶ | use Type::Tiny::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | 50 | package Attean::API::Parser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 62 | 50 | ▶ | use Types::Standard qw(CodeRef Bool); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | 50 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 50 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | 222 | ▶ | has 'handler' => (is => 'rw', isa => CodeRef, default => sub { sub {} }); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 50 | has 'lazy_iris' => (is => 'rw', isa => Bool, default => 0); | |||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | 50 | requires 'canonical_media_type'; # => (is => 'ro', isa => 'Str', init_arg => undef); | |||||||||||||||||||||||||||||||||||||||||
| 72 | 50 | requires 'media_types'; # => (is => 'ro', isa => 'ArrayRef[Str]', init_arg => undef); | |||||||||||||||||||||||||||||||||||||||||
| 73 | 50 | requires 'handled_type'; # => (is => 'ro', isa => 'Type::Tiny', init_arg => undef); | |||||||||||||||||||||||||||||||||||||||||
| 74 | 50 | requires 'file_extensions'; # => (is => 'ro', isa => 'ArrayRef[Str]', init_arg => undef); | |||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||
| 76 | =item C<< new_iri( value => $value ) >> | ||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | Constructs and returns a new L<Attean::IRI> object, respecting the parser's | ||||||||||||||||||||||||||||||||||||||||||
| 79 | C<lazy_iris> attribute. | ||||||||||||||||||||||||||||||||||||||||||
| 80 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||
| 82 | 295 | ▶ | sub new_iri { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new_iri: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 83 | 295 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 84 | 295 | my %args; | |||||||||||||||||||||||||||||||||||||||||
| 85 | 295 | ▶ | if ($self->lazy_iris) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | $args{lazy} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 87 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 88 | 295 | $args{lazy} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 295 | ▶ | if (scalar(@_) == 1) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | 94 | $args{value} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 92 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 93 | 201 | %args = (%args, @_); | |||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||
| 95 | 295 | return Attean::IRI->new(%args); | |||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | =item C<< new_literal( value => $value, [ datatype => $dt, ] [ language => $lang ]) >> | ||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | Constructs and returns a new L<Attean::Literal> object. | ||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||
| 102 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | 59 | ▶ | sub new_literal { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new_literal: called CC=3 SCAR=12.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 59 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 106 | 59 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||
| 107 | 59 | ▶ | if (exists $args{'language'} and $args{'language'} =~ m/^(.*)--(rtl|ltr)$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $args{"language"} and $args{"language"} =~ /^(.*)--(rtl|ltr)$/u
MC/DC0%0/2
exists $args{"language"} and $args{"language"} =~ /^(.*)--(rtl|ltr)$/u
exists $args{"language"}
$args{"language"} =~ /^(.*)--(rtl|ltr)$/u
Truth table66%2/3
A and B
A= exists $args{"language"}B= $args{"language"} =~ /^(.*)--(rtl|ltr)$/u
| |||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | $args{'language'} = $1; | |||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | $args{'base_dir'} = $2; | |||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 59 | return Attean::Literal->new(%args); | |||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | sub file_extensions { return [] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
file_extensions: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||
| 117 | 50 | package Attean::API::AbbreviatingParser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 118 | 50 | ▶ | use Types::Standard qw(ConsumerOf InstanceOf Maybe); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 119 | 50 | ▶ | use Types::Namespace qw( NamespaceMap ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 50 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||
| 122 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||
| 124 | 50 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 125 | 2 | ▶ | has 'base' => (is => 'rw', isa => ConsumerOf['Attean::API::IRI'], coerce => sub { blessed($_[0]) ? Attean::IRI->new($_[0]->as_string) : Attean::IRI->new($_[0]) }, predicate => 'has_base'); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | 50 | has 'namespaces' => (is => 'ro', isa => Maybe[NamespaceMap]); | |||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||
| 129 | 50 | package Attean::API::CDTBlankNodeMappingParser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 130 | 50 | ▶ | use Types::Standard qw(HashRef ConsumerOf InstanceOf Maybe Bool); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 131 | 50 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | 50 | ▶ | use UUID::Tiny ':std'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 50 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||
| 136 | 50 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 137 | 50 | has 'blank_nodes' => (is => 'ro', isa => Maybe[HashRef[ConsumerOf['Attean::API::Blank']]]); | |||||||||||||||||||||||||||||||||||||||||
| 138 | 96 | ▶ | has 'parse_id' => (is => 'rw', default => sub { unpack('H*', create_uuid()) }); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 139 | 50 | has 'enable_cdt_rewriting' => (is => 'rw', isa => Bool, default => 1); | |||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||
| 141 | 50 | foreach my $method (qw(parse_iter_from_io parse_iter_from_bytes parse_cb_from_io parse_cb_from_bytes)) { | |||||||||||||||||||||||||||||||||||||||||
| 142 | 94 | ▶ | around $method => sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 143 | 94 | my $orig = shift; | |||||||||||||||||||||||||||||||||||||||||
| 144 | 94 | my $self = $_[0]; | |||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||
| 146 | 94 | $self->parse_id(unpack('H*', create_uuid())); | |||||||||||||||||||||||||||||||||||||||||
| 147 | 94 | my $term = $orig->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 148 | 94 | return $term; | |||||||||||||||||||||||||||||||||||||||||
| 149 | 200 | }; | |||||||||||||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||
| 152 | 59 | ▶ | around 'new_literal' => sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=18.7
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | 59 | my $orig = shift; | |||||||||||||||||||||||||||||||||||||||||
| 154 | 59 | my $self = $_[0]; | |||||||||||||||||||||||||||||||||||||||||
| 155 | 59 | my $term = $orig->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 156 | 59 | ▶ | if ($self->enable_cdt_rewriting) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 157 | 59 | my $dt = $term->datatype(); | |||||||||||||||||||||||||||||||||||||||||
| 158 | 59 | ▶ | if (blessed($dt) and ($dt->value eq 'http://w3id.org/awslabs/neptune/SPARQL-CDTs/Map' or $dt->value eq 'http://w3id.org/awslabs/neptune/SPARQL-CDTs/List')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
builtin::blessed($dt) and $dt->value eq "http://w3id.org/awslabs/neptune/SPARQL-CDTs/Map" || $dt->value eq "http://w3id.org/awslabs/neptune/SPARQL-CDTs/List"
$dt->value eq "http://w3id.org/awslabs/neptune/SPARQL-CDTs/Map" or $dt->value eq "http://w3id.org/awslabs/neptune/SPARQL-CDTs/List"
MC/DC0%0/3
builtin::blessed($dt) and $dt->value eq "http://w3id.org/awslabs/neptune/SPARQL-CDTs/Map" || $dt->value eq "http://w3id.org/awslabs/neptune/SPARQL-CDTs/List"
builtin::blessed($dt)
$dt->value eq "http://w3id.org/awslabs/neptune/SPARQL-CDTs/Map"
$dt->value eq "http://w3id.org/awslabs/neptune/SPARQL-CDTs/List"
Truth table25%1/4
A and B or C
A= builtin::blessed($dt)B= $dt->value eq "http://w3id.org/awslabs/neptune/SPARQL-CDTs/Map"C= $dt->value eq "http://w3id.org/awslabs/neptune/SPARQL-CDTs/List"
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | return AtteanX::Functions::CompositeLists::rewrite_lexical($term, $self->blank_nodes, $self->parse_id); | |||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||
| 162 | 59 | return $term; | |||||||||||||||||||||||||||||||||||||||||
| 163 | 50 | }; | |||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||
| 166 | 50 | package Attean::API::PushParser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 167 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 168 | 50 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||
| 170 | 50 | requires 'parse_cb_from_io'; # parse_cb_from_io($io) | |||||||||||||||||||||||||||||||||||||||||
| 171 | 50 | requires 'parse_cb_from_bytes'; # parse_cb_from_bytes($data) | |||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||
| 173 | 2 | ▶ | sub parse_iter_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_iter_from_io: called CC=6 SCAR=27.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 174 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 175 | 2 | my @values = $self->parse_list_from_io(@_); | |||||||||||||||||||||||||||||||||||||||||
| 176 | 2 | ▶ | if ($self->does('Attean::API::ResultParser') or $self->does('Attean::API::ResultOrTermParser')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->does("Attean::API::ResultParser") or $self->does("Attean::API::ResultOrTermParser")
MC/DC0%0/2
$self->does("Attean::API::ResultParser") or $self->does("Attean::API::ResultOrTermParser")
$self->does("Attean::API::ResultParser")
$self->does("Attean::API::ResultOrTermParser")
Truth table33%1/3
A or B
A= $self->does("Attean::API::ResultParser")B= $self->does("Attean::API::ResultOrTermParser")
| |||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | my %vars; | |||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | foreach my $r (@values) { | |||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | ▶ | if ($r->does('Attean::API::Result')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | foreach my $v ($r->variables) { | |||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | $vars{$v}++; | |||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | return Attean::ListIterator->new( variables => [keys %vars], values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 186 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 187 | 2 | return Attean::ListIterator->new( values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||
| 191 | 29 | ▶ | sub parse_iter_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_iter_from_bytes: called CC=6 SCAR=18.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 192 | 29 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 193 | 29 | my @values = $self->parse_list_from_bytes(@_); | |||||||||||||||||||||||||||||||||||||||||
| 194 | 29 | ▶ | if ($self->does('Attean::API::ResultParser') or $self->does('Attean::API::ResultOrTermParser')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->does("Attean::API::ResultParser") or $self->does("Attean::API::ResultOrTermParser")
MC/DC50%1/2
$self->does("Attean::API::ResultParser") or $self->does("Attean::API::ResultOrTermParser")
$self->does("Attean::API::ResultParser")
$self->does("Attean::API::ResultOrTermParser")
Truth table66%2/3
A or B
A= $self->does("Attean::API::ResultParser")B= $self->does("Attean::API::ResultOrTermParser")
| |||||||||||||||||||||||||||||||||||||||||||
| 195 | 1 | my %vars; | |||||||||||||||||||||||||||||||||||||||||
| 196 | 1 | foreach my $r (@values) { | |||||||||||||||||||||||||||||||||||||||||
| 197 | 2 | ▶ | if ($r->does('Attean::API::Result')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 198 | 2 | foreach my $v ($r->variables) { | |||||||||||||||||||||||||||||||||||||||||
| 199 | 6 | $vars{$v}++; | |||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||
| 201 | } | ||||||||||||||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||||||||||||
| 203 | 1 | return Attean::ListIterator->new( variables => [keys %vars], values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 204 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 205 | 28 | return Attean::ListIterator->new( values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||
| 209 | 3 | ▶ | sub parse_list_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_list_from_io: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 210 | 3 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 211 | 3 | my @values; | |||||||||||||||||||||||||||||||||||||||||
| 212 | 5 | ▶ | $self->handler(sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 213 | 5 | push(@values, shift); | |||||||||||||||||||||||||||||||||||||||||
| 214 | 3 | }); | |||||||||||||||||||||||||||||||||||||||||
| 215 | 3 | $self->parse_cb_from_io(@_); | |||||||||||||||||||||||||||||||||||||||||
| 216 | 3 | return @values; | |||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||
| 219 | 33 | ▶ | sub parse_list_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_list_from_bytes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 220 | 33 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 221 | 33 | my @values; | |||||||||||||||||||||||||||||||||||||||||
| 222 | 91 | ▶ | $self->handler(sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 223 | 91 | push(@values, shift); | |||||||||||||||||||||||||||||||||||||||||
| 224 | 33 | }); | |||||||||||||||||||||||||||||||||||||||||
| 225 | 33 | $self->parse_cb_from_bytes(@_); | |||||||||||||||||||||||||||||||||||||||||
| 226 | 32 | return @values; | |||||||||||||||||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||
| 230 | 50 | package Attean::API::PullParser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 231 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 232 | 50 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||
| 234 | 50 | requires 'parse_iter_from_io'; # $iter = parse_iter_from_io($io) | |||||||||||||||||||||||||||||||||||||||||
| 235 | 50 | requires 'parse_iter_from_bytes'; # $iter = parse_iter_from_bytes($data) | |||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||
| 237 | 1 | ▶ | sub parse_cb_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_cb_from_io: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 238 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 239 | 1 | my $io = shift; | |||||||||||||||||||||||||||||||||||||||||
| 240 | 1 | my $handler = $self->handler; | |||||||||||||||||||||||||||||||||||||||||
| 241 | 1 | my $iter = $self->parse_iter_from_io($io); | |||||||||||||||||||||||||||||||||||||||||
| 242 | 1 | ▶ | while (my $item = $iter->next) { $handler->( $item ) } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||
| 245 | 2 | ▶ | sub parse_cb_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_cb_from_bytes: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 246 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 247 | 2 | my $data = shift; | |||||||||||||||||||||||||||||||||||||||||
| 248 | 2 | my $handler = $self->handler; | |||||||||||||||||||||||||||||||||||||||||
| 249 | 2 | my $iter = $self->parse_iter_from_bytes($data); | |||||||||||||||||||||||||||||||||||||||||
| 250 | 2 | ▶ | while (defined(my $item = $iter->next)) { $handler->( $item ) } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||
| 253 | 2 | ▶ | sub parse_list_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_list_from_io: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 254 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 255 | 2 | my $io = shift; | |||||||||||||||||||||||||||||||||||||||||
| 256 | 2 | my $iter = $self->parse_iter_from_io($io); | |||||||||||||||||||||||||||||||||||||||||
| 257 | 2 | my @list; | |||||||||||||||||||||||||||||||||||||||||
| 258 | 2 | ▶ | while (defined(my $item = $iter->next)) { push(@list, $item); } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 259 | 2 | return @list; | |||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||
| 262 | 15 | ▶ | sub parse_list_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_list_from_bytes: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 263 | 15 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 264 | 15 | my $data = shift; | |||||||||||||||||||||||||||||||||||||||||
| 265 | 15 | my $iter = $self->parse_iter_from_bytes($data); | |||||||||||||||||||||||||||||||||||||||||
| 266 | 15 | my @list; | |||||||||||||||||||||||||||||||||||||||||
| 267 | 15 | ▶ | while (defined(my $item = $iter->next)) { push(@list, $item); } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 268 | 12 | return @list; | |||||||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||||||
| 270 | } | ||||||||||||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||||||||||||
| 272 | 50 | package Attean::API::AtOnceParser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 273 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 274 | 50 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||
| 276 | 50 | requires 'parse_list_from_io'; # @list = parse_list_from_io($io) | |||||||||||||||||||||||||||||||||||||||||
| 277 | 50 | requires 'parse_list_from_bytes'; # @list = parse_list_from_bytes($data) | |||||||||||||||||||||||||||||||||||||||||
| 278 | |||||||||||||||||||||||||||||||||||||||||||
| 279 | 1 | ▶ | sub parse_cb_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_cb_from_io: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 280 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 281 | 1 | my $io = shift; | |||||||||||||||||||||||||||||||||||||||||
| 282 | 1 | my $handler = $self->handler; | |||||||||||||||||||||||||||||||||||||||||
| 283 | 1 | my $iter = $self->parse_iter_from_io($io); | |||||||||||||||||||||||||||||||||||||||||
| 284 | 1 | ▶ | while (my $item = $iter->next) { $handler->( $item ) } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 285 | } | ||||||||||||||||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||||||||||||||||
| 287 | 1 | ▶ | sub parse_cb_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_cb_from_bytes: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 288 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 289 | 1 | my $data = shift; | |||||||||||||||||||||||||||||||||||||||||
| 290 | 1 | my $handler = $self->handler; | |||||||||||||||||||||||||||||||||||||||||
| 291 | 1 | my $iter = $self->parse_iter_from_bytes($data); | |||||||||||||||||||||||||||||||||||||||||
| 292 | 1 | ▶ | while (defined(my $item = $iter->next)) { $handler->( $item ) } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||||||||||||||||
| 295 | 2 | ▶ | sub parse_iter_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_iter_from_io: called CC=6 SCAR=27.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 296 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 297 | 2 | my @values = $self->parse_list_from_io(@_); | |||||||||||||||||||||||||||||||||||||||||
| 298 | 2 | ▶ | if ($self->does('Attean::API::ResultParser') or $self->does('Attean::API::ResultOrTermParser')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->does("Attean::API::ResultParser") or $self->does("Attean::API::ResultOrTermParser")
MC/DC0%0/2
$self->does("Attean::API::ResultParser") or $self->does("Attean::API::ResultOrTermParser")
$self->does("Attean::API::ResultParser")
$self->does("Attean::API::ResultOrTermParser")
Truth table33%1/3
A or B
A= $self->does("Attean::API::ResultParser")B= $self->does("Attean::API::ResultOrTermParser")
| |||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | my %vars; | |||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | foreach my $r (@values) { | |||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | ▶ | if ($r->does('Attean::API::Result')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | foreach my $v ($r->variables) { | |||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | $vars{$v}++; | |||||||||||||||||||||||||||||||||||||||||
| 304 | } | ||||||||||||||||||||||||||||||||||||||||||
| 305 | } | ||||||||||||||||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | return Attean::ListIterator->new( variables => [keys %vars], values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 308 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 309 | 2 | return Attean::ListIterator->new( values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 310 | } | ||||||||||||||||||||||||||||||||||||||||||
| 311 | } | ||||||||||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||||||||||
| 313 | 1 | ▶ | sub parse_iter_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_iter_from_bytes: called CC=6 SCAR=19.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 314 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 315 | 1 | my @values = $self->parse_list_from_bytes(@_); | |||||||||||||||||||||||||||||||||||||||||
| 316 | 1 | ▶ | if ($self->does('Attean::API::ResultParser') or $self->does('Attean::API::ResultOrTermParser')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->does("Attean::API::ResultParser") or $self->does("Attean::API::ResultOrTermParser")
MC/DC0%0/2
$self->does("Attean::API::ResultParser") or $self->does("Attean::API::ResultOrTermParser")
$self->does("Attean::API::ResultParser")
$self->does("Attean::API::ResultOrTermParser")
Truth table33%1/3
A or B
A= $self->does("Attean::API::ResultParser")B= $self->does("Attean::API::ResultOrTermParser")
| |||||||||||||||||||||||||||||||||||||||||||
| 317 | 1 | my %vars; | |||||||||||||||||||||||||||||||||||||||||
| 318 | 1 | foreach my $r (@values) { | |||||||||||||||||||||||||||||||||||||||||
| 319 | 1 | ▶ | if ($r->does('Attean::API::Result')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 320 | 1 | foreach my $v ($r->variables) { | |||||||||||||||||||||||||||||||||||||||||
| 321 | 5 | $vars{$v}++; | |||||||||||||||||||||||||||||||||||||||||
| 322 | } | ||||||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||||||||||||||||
| 325 | 1 | return Attean::ListIterator->new( variables => [keys %vars], values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 326 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | return Attean::ListIterator->new( values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||||||||||||
| 329 | } | ||||||||||||||||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||||||||||||||||
| 331 | } | ||||||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||||||
| 333 | 50 | package Attean::API::TermParser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 334 | # Parser returns objects that conform to Attean::API::Term | ||||||||||||||||||||||||||||||||||||||||||
| 335 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 336 | 50 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 337 | 0 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::Term'); | |||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 340 | } | ||||||||||||||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||
| 343 | 50 | package Attean::API::TripleParser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 344 | # Parser returns objects that conform to Attean::API::Triple | ||||||||||||||||||||||||||||||||||||||||||
| 345 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 346 | 50 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 347 | 49 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 348 | 49 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::Triple'); | |||||||||||||||||||||||||||||||||||||||||
| 349 | 49 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 350 | } | ||||||||||||||||||||||||||||||||||||||||||
| 351 | } | ||||||||||||||||||||||||||||||||||||||||||
| 352 | |||||||||||||||||||||||||||||||||||||||||||
| 353 | 50 | package Attean::API::QuadParser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 354 | # Parser returns objects that conform to Attean::API::Quad | ||||||||||||||||||||||||||||||||||||||||||
| 355 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 356 | 50 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 357 | 0 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 358 | 0 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::Quad'); | |||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 360 | } | ||||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||||||||||
| 363 | 50 | package Attean::API::MixedStatementParser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 364 | # Parser returns objects that conform to either Attean::API::Triple or Attean::API::Quad | ||||||||||||||||||||||||||||||||||||||||||
| 365 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 366 | 50 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 367 | 10 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 368 | 10 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::TripleOrQuad'); | |||||||||||||||||||||||||||||||||||||||||
| 369 | 10 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 370 | } | ||||||||||||||||||||||||||||||||||||||||||
| 371 | } | ||||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||
| 373 | 50 | package Attean::API::ResultOrTermParser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 374 | # Parser returns objects that conform to either Attean::API::Result or Attean::API::Term | ||||||||||||||||||||||||||||||||||||||||||
| 375 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 376 | 50 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 377 | 8 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 378 | 8 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::ResultOrTerm'); | |||||||||||||||||||||||||||||||||||||||||
| 379 | 8 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 380 | } | ||||||||||||||||||||||||||||||||||||||||||
| 381 | } | ||||||||||||||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||||||||||||
| 383 | 50 | package Attean::API::ResultParser 0.040 { | |||||||||||||||||||||||||||||||||||||||||
| 384 | # Parser returns objects that conform to Attean::API::Result | ||||||||||||||||||||||||||||||||||||||||||
| 385 | 50 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 386 | 50 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 387 | 5 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 388 | 5 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::Result'); | |||||||||||||||||||||||||||||||||||||||||
| 389 | 5 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 390 | } | ||||||||||||||||||||||||||||||||||||||||||
| 391 | } | ||||||||||||||||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||||||||||||||||
| 393 | 50 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 394 | |||||||||||||||||||||||||||||||||||||||||||
| 395 | __END__ | ||||||||||||||||||||||||||||||||||||||||||