| 1 | 51 | ▶ | use v5.14; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 2 | 51 | ▶ | 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.041 | ||||||||||||||||||||||||||||||||||||||||||
| 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 | 51 | ▶ | use Type::Tiny::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | 51 | package Attean::API::Parser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 62 | 51 | ▶ | use Types::Standard qw(CodeRef Bool); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | 51 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 51 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | 236 | ▶ | 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 | 51 | has 'lazy_iris' => (is => 'rw', isa => Bool, default => 0); | |||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | 51 | requires 'canonical_media_type'; # => (is => 'ro', isa => 'Str', init_arg => undef); | |||||||||||||||||||||||||||||||||||||||||
| 72 | 51 | requires 'media_types'; # => (is => 'ro', isa => 'ArrayRef[Str]', init_arg => undef); | |||||||||||||||||||||||||||||||||||||||||
| 73 | 51 | requires 'handled_type'; # => (is => 'ro', isa => 'Type::Tiny', init_arg => undef); | |||||||||||||||||||||||||||||||||||||||||
| 74 | 51 | 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 | 296 | ▶ | sub new_iri { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new_iri: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 83 | 296 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 84 | 296 | my %args; | |||||||||||||||||||||||||||||||||||||||||
| 85 | 296 | ▶ | if ($self->lazy_iris) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | $args{lazy} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 87 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 88 | 296 | $args{lazy} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 296 | ▶ | if (scalar(@_) == 1) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | 94 | $args{value} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 92 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 93 | 202 | %args = (%args, @_); | |||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||
| 95 | 296 | 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 | 72 | ▶ | sub new_literal { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new_literal: called CC=8 SCAR=24.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 72 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 106 | 72 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||
| 107 | 72 | ▶ | if (exists $args{'language'}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 108 | 6 | my $lang = $args{'language'}; | |||||||||||||||||||||||||||||||||||||||||
| 109 | 6 | ▶ | if ($lang =~ m/^(.*)--(rtl|ltr)$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | ($lang, my $dir) = ($1, $2); | |||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | $args{'language'} = $lang; | |||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | $args{'base_dir'} = $dir; | |||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | 6 | ▶ | unless ($lang =~ /^([A-Za-z]{2,3}|x|i)\b/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | die "Invalid language tag syntax '$lang'"; | |||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||
| 117 | } elsif (my $dt = $args{'datatype'}) { | ||||||||||||||||||||||||||||||||||||||||||
| 118 | 28 | ▶ | my $d = ref($dt) ? $dt->value : $dt; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 119 | 28 | ▶ | if ($d eq 'http://www.w3.org/1999/02/22-rdf-syntax-ns#langString') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | die 'Literal without a language tag cannot decalre rdf:langString as a datatype'; | |||||||||||||||||||||||||||||||||||||||||
| 121 | } elsif ($d eq 'http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString') { | ||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | die 'Literal without a language tag cannot decalre rdf:dirLangString as a datatype'; | |||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||
| 125 | 72 | return Attean::Literal->new(%args); | |||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | sub file_extensions { return [] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
file_extensions: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||
| 131 | 51 | package Attean::API::AbbreviatingParser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 132 | 51 | ▶ | use Types::Standard qw(ConsumerOf InstanceOf Maybe); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 51 | ▶ | use Types::Namespace qw( NamespaceMap ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | 51 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||
| 136 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||
| 138 | 51 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 139 | 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
| |||||||||||||||||||||||||||||||||||||||||||
| 140 | 51 | has 'namespaces' => (is => 'ro', isa => Maybe[NamespaceMap]); | |||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||
| 143 | 51 | package Attean::API::CDTBlankNodeMappingParser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 144 | 51 | ▶ | use Types::Standard qw(HashRef ConsumerOf InstanceOf Maybe Bool); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 145 | 51 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 146 | 51 | ▶ | use UUID::Tiny ':std'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 147 | 51 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 148 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||
| 150 | 51 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 151 | 51 | has 'blank_nodes' => (is => 'ro', isa => Maybe[HashRef[ConsumerOf['Attean::API::Blank']]]); | |||||||||||||||||||||||||||||||||||||||||
| 152 | 109 | ▶ | has 'parse_id' => (is => 'rw', default => sub { unpack('H*', create_uuid()) }); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | 51 | has 'enable_cdt_rewriting' => (is => 'rw', isa => Bool, default => 1); | |||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||
| 155 | 51 | foreach my $method (qw(parse_iter_from_io parse_iter_from_bytes parse_cb_from_io parse_cb_from_bytes)) { | |||||||||||||||||||||||||||||||||||||||||
| 156 | 94 | ▶ | around $method => sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 157 | 94 | my $orig = shift; | |||||||||||||||||||||||||||||||||||||||||
| 158 | 94 | my $self = $_[0]; | |||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||
| 160 | 94 | $self->parse_id(unpack('H*', create_uuid())); | |||||||||||||||||||||||||||||||||||||||||
| 161 | 94 | my $term = $orig->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 162 | 94 | return $term; | |||||||||||||||||||||||||||||||||||||||||
| 163 | 204 | }; | |||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||
| 166 | 72 | ▶ | around 'new_literal' => sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=17.8
| |||||||||||||||||||||||||||||||||||||||||||
| 167 | 72 | my $orig = shift; | |||||||||||||||||||||||||||||||||||||||||
| 168 | 72 | my $self = $_[0]; | |||||||||||||||||||||||||||||||||||||||||
| 169 | 72 | my $term = $orig->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 170 | 72 | ▶ | if ($self->enable_cdt_rewriting) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 171 | 59 | my $dt = $term->datatype(); | |||||||||||||||||||||||||||||||||||||||||
| 172 | 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"
| |||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | return AtteanX::Functions::CompositeLists::rewrite_lexical($term, $self->blank_nodes, $self->parse_id); | |||||||||||||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||
| 176 | 72 | return $term; | |||||||||||||||||||||||||||||||||||||||||
| 177 | 51 | }; | |||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||
| 180 | 51 | package Attean::API::PushParser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 181 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 182 | 51 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||
| 184 | 51 | requires 'parse_cb_from_io'; # parse_cb_from_io($io) | |||||||||||||||||||||||||||||||||||||||||
| 185 | 51 | requires 'parse_cb_from_bytes'; # parse_cb_from_bytes($data) | |||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||
| 187 | 2 | ▶ | sub parse_iter_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_iter_from_io: called CC=6 SCAR=27.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 188 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 189 | 2 | my @values = $self->parse_list_from_io(@_); | |||||||||||||||||||||||||||||||||||||||||
| 190 | 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")
| |||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | my %vars; | |||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | foreach my $r (@values) { | |||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | if ($r->does('Attean::API::Result')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | foreach my $v ($r->variables) { | |||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | $vars{$v}++; | |||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | return Attean::ListIterator->new( variables => [keys %vars], values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 200 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 201 | 2 | return Attean::ListIterator->new( values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||
| 205 | 30 | ▶ | sub parse_iter_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_iter_from_bytes: called CC=6 SCAR=18.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 206 | 30 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 207 | 30 | my @values = $self->parse_list_from_bytes(@_); | |||||||||||||||||||||||||||||||||||||||||
| 208 | 30 | ▶ | 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")
| |||||||||||||||||||||||||||||||||||||||||||
| 209 | 2 | my %vars; | |||||||||||||||||||||||||||||||||||||||||
| 210 | 2 | foreach my $r (@values) { | |||||||||||||||||||||||||||||||||||||||||
| 211 | 4 | ▶ | if ($r->does('Attean::API::Result')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 212 | 4 | foreach my $v ($r->variables) { | |||||||||||||||||||||||||||||||||||||||||
| 213 | 12 | $vars{$v}++; | |||||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||||||||
| 217 | 2 | return Attean::ListIterator->new( variables => [keys %vars], values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 218 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 219 | 28 | return Attean::ListIterator->new( values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||
| 223 | 3 | ▶ | sub parse_list_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_list_from_io: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 224 | 3 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 225 | 3 | my @values; | |||||||||||||||||||||||||||||||||||||||||
| 226 | 5 | ▶ | $self->handler(sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 227 | 5 | push(@values, shift); | |||||||||||||||||||||||||||||||||||||||||
| 228 | 3 | }); | |||||||||||||||||||||||||||||||||||||||||
| 229 | 3 | $self->parse_cb_from_io(@_); | |||||||||||||||||||||||||||||||||||||||||
| 230 | 3 | return @values; | |||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||
| 233 | 34 | ▶ | sub parse_list_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_list_from_bytes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 234 | 34 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 235 | 34 | my @values; | |||||||||||||||||||||||||||||||||||||||||
| 236 | 93 | ▶ | $self->handler(sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 237 | 93 | push(@values, shift); | |||||||||||||||||||||||||||||||||||||||||
| 238 | 34 | }); | |||||||||||||||||||||||||||||||||||||||||
| 239 | 34 | $self->parse_cb_from_bytes(@_); | |||||||||||||||||||||||||||||||||||||||||
| 240 | 33 | return @values; | |||||||||||||||||||||||||||||||||||||||||
| 241 | } | ||||||||||||||||||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||
| 244 | 51 | package Attean::API::PullParser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 245 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 246 | 51 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||
| 248 | 51 | requires 'parse_iter_from_io'; # $iter = parse_iter_from_io($io) | |||||||||||||||||||||||||||||||||||||||||
| 249 | 51 | requires 'parse_iter_from_bytes'; # $iter = parse_iter_from_bytes($data) | |||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||
| 251 | 1 | ▶ | sub parse_cb_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_cb_from_io: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 252 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 253 | 1 | my $io = shift; | |||||||||||||||||||||||||||||||||||||||||
| 254 | 1 | my $handler = $self->handler; | |||||||||||||||||||||||||||||||||||||||||
| 255 | 1 | my $iter = $self->parse_iter_from_io($io); | |||||||||||||||||||||||||||||||||||||||||
| 256 | 1 | ▶ | while (my $item = $iter->next) { $handler->( $item ) } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||||||
| 259 | 2 | ▶ | sub parse_cb_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_cb_from_bytes: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 260 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 261 | 2 | my $data = shift; | |||||||||||||||||||||||||||||||||||||||||
| 262 | 2 | my $handler = $self->handler; | |||||||||||||||||||||||||||||||||||||||||
| 263 | 2 | my $iter = $self->parse_iter_from_bytes($data); | |||||||||||||||||||||||||||||||||||||||||
| 264 | 2 | ▶ | while (defined(my $item = $iter->next)) { $handler->( $item ) } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||
| 267 | 2 | ▶ | sub parse_list_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_list_from_io: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 268 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 269 | 2 | my $io = shift; | |||||||||||||||||||||||||||||||||||||||||
| 270 | 2 | my $iter = $self->parse_iter_from_io($io); | |||||||||||||||||||||||||||||||||||||||||
| 271 | 2 | my @list; | |||||||||||||||||||||||||||||||||||||||||
| 272 | 2 | ▶ | while (defined(my $item = $iter->next)) { push(@list, $item); } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 273 | 2 | return @list; | |||||||||||||||||||||||||||||||||||||||||
| 274 | } | ||||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||
| 276 | 15 | ▶ | sub parse_list_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_list_from_bytes: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 277 | 15 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 278 | 15 | my $data = shift; | |||||||||||||||||||||||||||||||||||||||||
| 279 | 15 | my $iter = $self->parse_iter_from_bytes($data); | |||||||||||||||||||||||||||||||||||||||||
| 280 | 15 | my @list; | |||||||||||||||||||||||||||||||||||||||||
| 281 | 15 | ▶ | while (defined(my $item = $iter->next)) { push(@list, $item); } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 282 | 12 | return @list; | |||||||||||||||||||||||||||||||||||||||||
| 283 | } | ||||||||||||||||||||||||||||||||||||||||||
| 284 | } | ||||||||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||||||||
| 286 | 51 | package Attean::API::AtOnceParser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 287 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 288 | 51 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||||||||||||
| 290 | 51 | requires 'parse_list_from_io'; # @list = parse_list_from_io($io) | |||||||||||||||||||||||||||||||||||||||||
| 291 | 51 | requires 'parse_list_from_bytes'; # @list = parse_list_from_bytes($data) | |||||||||||||||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||||||||||||||||
| 293 | 1 | ▶ | sub parse_cb_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_cb_from_io: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 294 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 295 | 1 | my $io = shift; | |||||||||||||||||||||||||||||||||||||||||
| 296 | 1 | my $handler = $self->handler; | |||||||||||||||||||||||||||||||||||||||||
| 297 | 1 | my $iter = $self->parse_iter_from_io($io); | |||||||||||||||||||||||||||||||||||||||||
| 298 | 1 | ▶ | while (my $item = $iter->next) { $handler->( $item ) } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 299 | } | ||||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||
| 301 | 1 | ▶ | sub parse_cb_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_cb_from_bytes: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 302 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 303 | 1 | my $data = shift; | |||||||||||||||||||||||||||||||||||||||||
| 304 | 1 | my $handler = $self->handler; | |||||||||||||||||||||||||||||||||||||||||
| 305 | 1 | my $iter = $self->parse_iter_from_bytes($data); | |||||||||||||||||||||||||||||||||||||||||
| 306 | 1 | ▶ | while (defined(my $item = $iter->next)) { $handler->( $item ) } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 307 | } | ||||||||||||||||||||||||||||||||||||||||||
| 308 | |||||||||||||||||||||||||||||||||||||||||||
| 309 | 2 | ▶ | sub parse_iter_from_io { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_iter_from_io: called CC=6 SCAR=27.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 310 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 311 | 2 | my @values = $self->parse_list_from_io(@_); | |||||||||||||||||||||||||||||||||||||||||
| 312 | 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")
| |||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | my %vars; | |||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | foreach my $r (@values) { | |||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | ▶ | if ($r->does('Attean::API::Result')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 316 | 0 | foreach my $v ($r->variables) { | |||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | $vars{$v}++; | |||||||||||||||||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||||||||||||||||
| 319 | } | ||||||||||||||||||||||||||||||||||||||||||
| 320 | } | ||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | return Attean::ListIterator->new( variables => [keys %vars], values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 322 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 323 | 2 | return Attean::ListIterator->new( values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||||||||||||||||
| 325 | } | ||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||
| 327 | 1 | ▶ | sub parse_iter_from_bytes { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_iter_from_bytes: called CC=6 SCAR=19.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 328 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 329 | 1 | my @values = $self->parse_list_from_bytes(@_); | |||||||||||||||||||||||||||||||||||||||||
| 330 | 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")
| |||||||||||||||||||||||||||||||||||||||||||
| 331 | 1 | my %vars; | |||||||||||||||||||||||||||||||||||||||||
| 332 | 1 | foreach my $r (@values) { | |||||||||||||||||||||||||||||||||||||||||
| 333 | 1 | ▶ | if ($r->does('Attean::API::Result')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 334 | 1 | foreach my $v ($r->variables) { | |||||||||||||||||||||||||||||||||||||||||
| 335 | 5 | $vars{$v}++; | |||||||||||||||||||||||||||||||||||||||||
| 336 | } | ||||||||||||||||||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||||||||||||||||
| 338 | } | ||||||||||||||||||||||||||||||||||||||||||
| 339 | 1 | return Attean::ListIterator->new( variables => [keys %vars], values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 340 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 341 | 0 | return Attean::ListIterator->new( values => \@values, item_type => $self->handled_type->role, ); | |||||||||||||||||||||||||||||||||||||||||
| 342 | } | ||||||||||||||||||||||||||||||||||||||||||
| 343 | } | ||||||||||||||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||||||||||||||
| 345 | } | ||||||||||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||||||||||
| 347 | 51 | package Attean::API::TermParser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 348 | # Parser returns objects that conform to Attean::API::Term | ||||||||||||||||||||||||||||||||||||||||||
| 349 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 350 | 51 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 352 | 0 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::Term'); | |||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 354 | } | ||||||||||||||||||||||||||||||||||||||||||
| 355 | } | ||||||||||||||||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||||||||||||||||
| 357 | 51 | package Attean::API::TripleParser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 358 | # Parser returns objects that conform to Attean::API::Triple | ||||||||||||||||||||||||||||||||||||||||||
| 359 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 360 | 51 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 361 | 49 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 362 | 49 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::Triple'); | |||||||||||||||||||||||||||||||||||||||||
| 363 | 49 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 364 | } | ||||||||||||||||||||||||||||||||||||||||||
| 365 | } | ||||||||||||||||||||||||||||||||||||||||||
| 366 | |||||||||||||||||||||||||||||||||||||||||||
| 367 | 51 | package Attean::API::QuadParser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 368 | # Parser returns objects that conform to Attean::API::Quad | ||||||||||||||||||||||||||||||||||||||||||
| 369 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 370 | 51 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 371 | 0 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 372 | 0 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::Quad'); | |||||||||||||||||||||||||||||||||||||||||
| 373 | 0 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 374 | } | ||||||||||||||||||||||||||||||||||||||||||
| 375 | } | ||||||||||||||||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||||||||||||||||
| 377 | 51 | package Attean::API::MixedStatementParser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 378 | # Parser returns objects that conform to either Attean::API::Triple or Attean::API::Quad | ||||||||||||||||||||||||||||||||||||||||||
| 379 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 380 | 51 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 381 | 10 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 382 | 10 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::TripleOrQuad'); | |||||||||||||||||||||||||||||||||||||||||
| 383 | 10 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 384 | } | ||||||||||||||||||||||||||||||||||||||||||
| 385 | } | ||||||||||||||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||||||||||||
| 387 | 51 | package Attean::API::ResultOrTermParser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 388 | # Parser returns objects that conform to either Attean::API::Result or Attean::API::Term | ||||||||||||||||||||||||||||||||||||||||||
| 389 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 390 | 51 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 391 | 9 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 392 | 9 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::ResultOrTerm'); | |||||||||||||||||||||||||||||||||||||||||
| 393 | 9 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 394 | } | ||||||||||||||||||||||||||||||||||||||||||
| 395 | } | ||||||||||||||||||||||||||||||||||||||||||
| 396 | |||||||||||||||||||||||||||||||||||||||||||
| 397 | 51 | package Attean::API::ResultParser 0.041 { | |||||||||||||||||||||||||||||||||||||||||
| 398 | # Parser returns objects that conform to Attean::API::Result | ||||||||||||||||||||||||||||||||||||||||||
| 399 | 51 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 400 | 51 | with 'Attean::API::Parser'; | |||||||||||||||||||||||||||||||||||||||||
| 401 | 5 | ▶ | sub handled_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handled_type: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 402 | 5 | state $ITEM_TYPE = Type::Tiny::Role->new(role => 'Attean::API::Result'); | |||||||||||||||||||||||||||||||||||||||||
| 403 | 5 | return $ITEM_TYPE; | |||||||||||||||||||||||||||||||||||||||||
| 404 | } | ||||||||||||||||||||||||||||||||||||||||||
| 405 | } | ||||||||||||||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||||||||||||||
| 407 | 51 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 408 | |||||||||||||||||||||||||||||||||||||||||||
| 409 | __END__ | ||||||||||||||||||||||||||||||||||||||||||