« blib/lib/Perl/PrereqScanner/NotQuiteLite/Parser/Unless.pm
↑ Summary
lib/Perl/PrereqScanner/NotQuiteLite/Parser/ClassLoad.pm »
| 1 | package Perl::PrereqScanner::NotQuiteLite::Parser::ClassAccessor; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 88 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 88 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 88 | ▶ | use Perl::PrereqScanner::NotQuiteLite::Util; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | sub register {{ | ||||||||||||||||||||||||||||
| 8 | 87 | ▶ | use => { | ||||||||||||||||||||||||||
|
Subroutine
register: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 9 | 'Class::Accessor' => 'parse_class_accessor_args', | ||||||||||||||||||||||||||||
| 10 | 'Class::Accessor::Fast' => 'parse_class_accessor_args', | ||||||||||||||||||||||||||||
| 11 | 'Class::Accessor::Faster' => 'parse_class_accessor_args', | ||||||||||||||||||||||||||||
| 12 | 'Class::XSAccessor::Compat' => 'parse_class_accessor_args', | ||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||
| 14 | }} | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | sub parse_class_accessor_args { | ||||||||||||||||||||||||||||
| 17 | 2 | ▶ | my ($class, $c, $used_module, $raw_tokens) = @_; | ||||||||||||||||||||||||||
|
Subroutine
parse_class_accessor_args: called CC=4 SCAR=14.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 2 | my $tokens = convert_string_tokens($raw_tokens); | |||||||||||||||||||||||||||
| 20 | 2 | ▶ | if (is_version($tokens->[0])) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 0 | $c->add($used_module => shift @$tokens); | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | 2 | ▶ | while(my $token = shift @$tokens) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 2 | ▶ | if ($token =~ /^(?:antlers|moose-?like)$/i) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | 2 | $c->register_keyword_parser( | |||||||||||||||||||||||||||
| 26 | 'extends', | ||||||||||||||||||||||||||||
| 27 | [$class, 'parse_extends_args', $used_module], | ||||||||||||||||||||||||||||
| 28 | ); | ||||||||||||||||||||||||||||
| 29 | 2 | last; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | sub parse_extends_args { | ||||||||||||||||||||||||||||
| 35 | 2 | ▶ | my ($class, $c, $used_module, $raw_tokens) = @_; | ||||||||||||||||||||||||||
|
Subroutine
parse_extends_args: called CC=12 SCAR=39.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 2 | my $tokens = convert_string_tokens($raw_tokens); | |||||||||||||||||||||||||||
| 38 | 2 | shift @$tokens; # discard extends, with; | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 2 | my $prev; | |||||||||||||||||||||||||||
| 41 | 2 | for my $token (@$tokens) { | |||||||||||||||||||||||||||
| 42 | 4 | ▶ | if (!ref $token) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 2 | $c->add($token => 0); | |||||||||||||||||||||||||||
| 44 | 2 | $prev = $token; | |||||||||||||||||||||||||||
| 45 | 2 | next; | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | 2 | ▶ | my $desc = $token->[1] || ''; | ||||||||||||||||||||||||||
|
Condition50%1/2
$token->[1] || ''
MC/DC0%0/1
$token->[1] || ''
$token->[1]
Truth table50%1/2
A
A= $token->[1]
| |||||||||||||||||||||||||||||
| 48 | 2 | ▶ | if ($desc eq '{}') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 49 | 0 | ▶ | my @hash_tokens = @{$token->[0] || []}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 50 | 0 | ▶ | for(my $i = 0, my $len = @hash_tokens; $i < $len; $i++) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | 0 | ▶ | if ($hash_tokens[$i][0] eq '-version' and $i < $len - 2) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$hash_tokens[$i][0] eq "-version" and $i < $len - 2
MC/DC0%0/2
$hash_tokens[$i][0] eq "-version" and $i < $len - 2
$hash_tokens[$i][0] eq "-version"
$i < $len - 2
Truth table0%0/3
A and B
A= $hash_tokens[$i][0] eq "-version"B= $i < $len - 2
| |||||||||||||||||||||||||||||
| 52 | 0 | my $maybe_version_token = $hash_tokens[$i + 2]; | |||||||||||||||||||||||||||
| 53 | 0 | my $maybe_version = $maybe_version_token->[0]; | |||||||||||||||||||||||||||
| 54 | 0 | ▶ | if (ref $maybe_version) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 55 | 0 | $maybe_version = $maybe_version->[0]; | |||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | 0 | ▶ | if ($prev and is_version($maybe_version)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$prev and is_version($maybe_version)
MC/DC0%0/2
$prev and is_version($maybe_version)
$prev
is_version($maybe_version)
Truth table0%0/3
A and B
A= $prevB= is_version($maybe_version)
| |||||||||||||||||||||||||||||
| 58 | 0 | $c->add($prev => $maybe_version); | |||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 88 | 1; | |||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | __END__ | ||||||||||||||||||||||||||||