blib/lib/MarpaX/ESLIF.pm

filter: Statementstmt 85.7% 42 / 49 Branchbran 16.6% 1 / 6 Conditioncond 5.2% 1 / 19 MC/DCmcdc 0.0% 0 / 9 Subroutinesub 80.9% 17 / 21 Podpod n/a totaltotal 58.6% 61 / 104 CC 11 SCAR 20.8
CC
11
Cov
59%
__ANON__
30.0
_nvtype_is_long_double
12.0
_nvtype_is___float128
12.0
CRAP 8.0
« blib/lib/MarpaX/ESLIF/JSON/Decoder.pm ↑ Summary blib/lib/MarpaX/ESLIF/Grammar.pm »
1 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 10 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package MarpaX::ESLIF;
5 10 ▶use parent qw/MarpaX::ESLIF::Base/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 10 ▶use MarpaX::ESLIF::String; # Make sure it is loaded, the XS is using it
Subroutine BEGIN: called CC=1 SCAR=0.0
7 10 ▶use MarpaX::ESLIF::RegexCallout; # Make sure it is loaded, the XS is using it
Subroutine BEGIN: called CC=1 SCAR=0.0
8 10 ▶use XSLoader ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # ABSTRACT: ESLIF is Extended ScanLess InterFace
11  
12 our $AUTHORITY = 'cpan:JDDPAUSE'; # AUTHORITY
13  
14 10 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 #
17 # Base required class methods
18 #
19 0 ▶sub _CLONABLE { return sub { 1 } }
Subroutine _CLONABLE: called CC=1 SCAR=1.2
Subroutine __ANON__: not called CC=1 SCAR=1.2
20 8 ▶sub _ALLOCATE { return \&MarpaX::ESLIF::allocate }
Subroutine _ALLOCATE: called CC=1 SCAR=0.0
21 8 ▶sub _DISPOSE { return \&MarpaX::ESLIF::dispose }
Subroutine _DISPOSE: called CC=1 SCAR=0.0
22 8 ▶sub _EQ {
Subroutine _EQ: called CC=1 SCAR=6.1
23 0 ▶ return sub {
Subroutine __ANON__: not called CC=5 SCAR=34.0
24 0 my ($class, $args_ref, $loggerInterface) = @_;
25  
26 0 my $definedLoggerInterface = defined($loggerInterface); # It is legal to create an eslif with no logger interface
27 0 my $_definedLoggerInterface = defined($args_ref->[0]);
28 return
29 (
30 0 ▶ (! $definedLoggerInterface && ! $_definedLoggerInterface)
Condition0%0/12
!($definedLoggerInterface || $_definedLoggerInterface) || $definedLoggerInterface && $_definedLoggerInterface && $loggerInterface == $args_ref->[0]
l!l&&r!l&&!r
000
$definedLoggerInterface || $_definedLoggerInterface
l!l&&r!l&&!r
000
$definedLoggerInterface and $_definedLoggerInterface and $loggerInterface == $args_ref->[0]
!ll&&!rl&&r
000
$definedLoggerInterface and $_definedLoggerInterface
!ll&&!rl&&r
000
MC/DC0%0/5
!($definedLoggerInterface || $_definedLoggerInterface) || $definedLoggerInterface && $_definedLoggerInterface && $loggerInterface == $args_ref->[0]
$definedLoggerInterface $_definedLoggerInterface $definedLoggerInterface $_definedLoggerInterface $loggerInterface == $args_ref->[0]
Truth table0%0/9
not(A || B) || C and D and E
A= $definedLoggerInterfaceB= $_definedLoggerInterfaceC= $definedLoggerInterfaceD= $_definedLoggerInterfaceE= $loggerInterface == $args_ref->[0]
ABCDEresult
00XXX1
1X1111
011111
1X0XX0
1X10X0
1X1100
010XX0
0110X0
011100
31 ||
32 ($definedLoggerInterface && $_definedLoggerInterface && ($loggerInterface == $args_ref->[0]))
33 )
34 }
35 8 }
36  
37 #
38 # Internal routine used at bootstrap that says is nvtype is a double
39 #
40 0 ▶sub _nvtype_is_long_double {
Subroutine _nvtype_is_long_double: not called CC=3 SCAR=24.8
41 0 ▶ return (($Config{nvtype} || '') =~ /^\s*long\s+double\s*$/) ? 1 : 0
Branch: 1 branch
BranchTrueFalseTotal
($MarpaX::ESLIF::Config{'nvtype'} || '') =~ /^\s*long\s+double\s*$/ ? : 0 0 0
Condition0%0/2
$MarpaX::ESLIF::Config{'nvtype'} || ''
l!l
00
MC/DC0%0/1
$MarpaX::ESLIF::Config{'nvtype'} || ''
$MarpaX::ESLIF::Config{'nvtype'}
Truth table0%0/2
A
A= $MarpaX::ESLIF::Config{'nvtype'}
Aresult
11
00
42 }
43 #
44 # Internal routine used at bootstrap that says is nvtype is a __float128
45 #
46 0 ▶sub _nvtype_is___float128 {
Subroutine _nvtype_is___float128: not called CC=3 SCAR=24.8
47 0 ▶ return (($Config{nvtype} || '') eq '__float128') ? 1 : 0
Branch: 1 branch
BranchTrueFalseTotal
($MarpaX::ESLIF::Config{'nvtype'} || '') eq '__float128' ? : 0 0 0
Condition0%0/2
$MarpaX::ESLIF::Config{'nvtype'} || ''
l!l
00
MC/DC0%0/1
$MarpaX::ESLIF::Config{'nvtype'} || ''
$MarpaX::ESLIF::Config{'nvtype'}
Truth table0%0/2
A
A= $MarpaX::ESLIF::Config{'nvtype'}
Aresult
11
00
48 }
49  
50 #
51 # At bootstrap we cache $true and $false so they must be available before the XS loader
52 #
53 our $true;
54 our $false;
55 10 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
56 10 ▶ use JSON::MaybeXS 1.004000 qw//;
Subroutine BEGIN: called CC=1 SCAR=0.0
57 10 $true = JSON::MaybeXS::true();
58 10 $false = JSON::MaybeXS::false();
59 }
60  
61 #
62 # Bootstrap
63 #
64 10 ▶BEGIN {
Subroutine BEGIN: called CC=3 SCAR=11.1
65 #
66 10 our $VERSION = '6.0.35.1'; # VERSION
67 #
68 # Note that $VERSION is always defined when you use a distributed CPAN package.
69 # With old versions of perl, only the XSLoader::load(__PACKAGE__, $version) works.
70 # E.g. with perl-5.10, doing directly:
71 # make test
72 # within the repository may yell like this:
73 # Error: XSLoader::load('Your::Module', $Your::Module::VERSION)
74 # In this case, you can put the module version in the MARPAX_ESLIF_VERSION
75 # environment variable, e.g.:
76 # MARPAX_ESLIF_VERSION=999.999.999 make test
77 #
78 # Modules that we depend on bootstrap
79 10 ▶ use Math::BigFloat qw//;
Subroutine BEGIN: called CC=1 SCAR=0.0
80 10 ▶ use Math::BigInt qw//;
Subroutine BEGIN: called CC=1 SCAR=0.0
81 10 ▶ use Encode qw//;
Subroutine BEGIN: called CC=1 SCAR=0.0
82 10 ▶ my $version = eval q{$VERSION} // $ENV{MARPAX_ESLIF_VERSION}; ## no critic
Condition33%1/3
eval "\$VERSION" // $ENV{"MARPAX_ESLIF_VERSION"}
l!l&&r!l&&!r
1000
MC/DC0%0/2
eval "\$VERSION" // $ENV{"MARPAX_ESLIF_VERSION"}
eval "\$VERSION" $ENV{"MARPAX_ESLIF_VERSION"}
Truth table33%1/3
A // B
A= eval "\$VERSION"B= $ENV{"MARPAX_ESLIF_VERSION"}
ABresult
1X1
011
000
83 10 ▶ defined($version) ? XSLoader::load(__PACKAGE__, $version) : XSLoader::load();
Branch: 1 branch
BranchTrueFalseTotal
defined $version ? : 10 0 10
84 }
85  
86 # Load our explicit sub-modules
87 use MarpaX::ESLIF::Event::Type;
88 use MarpaX::ESLIF::Grammar;
89 use MarpaX::ESLIF::Grammar::Properties;
90 use MarpaX::ESLIF::Grammar::Rule::Properties;
91 use MarpaX::ESLIF::Grammar::Symbol::Properties;
92 use MarpaX::ESLIF::JSON;
93 use MarpaX::ESLIF::Logger::Level;
94 use MarpaX::ESLIF::Recognizer;
95 use MarpaX::ESLIF::Symbol;
96 use MarpaX::ESLIF::Symbol::PropertyBitSet;
97 use MarpaX::ESLIF::Symbol::EventBitSet;
98 use MarpaX::ESLIF::Symbol::Type;
99 use MarpaX::ESLIF::Value;
100 use MarpaX::ESLIF::Value::Type;
101 use MarpaX::ESLIF::Rule::PropertyBitSet;
102  
103  
104 sub getInstance {
105 goto &new
106 }
107  
108  
109 *is_bool = \&JSON::MaybeXS::is_bool;
110  
111  
112 1;
113  
114 __END__
« blib/lib/MarpaX/ESLIF/JSON/Decoder.pm ↑ Summary blib/lib/MarpaX/ESLIF/Grammar.pm »