File Coverage

blib/lib/Syntax/Infix/OptionalChain.pm
Criterion Covered Total %
statement 12 13 92.3
branch n/a
condition n/a
subroutine 5 6 83.3
pod n/a
total 17 19 89.4


line stmt bran cond sub pod time code
1             package Syntax::Infix::OptionalChain;
2              
3 3     3   259877 use 5.038;
  3         12  
4 3     3   11 use strict;
  3         5  
  3         81  
5 3     3   9 use warnings;
  3         5  
  3         108  
6              
7 3     3   1124 use Infix::Custom ();
  3         1452  
  3         329  
8              
9             our $VERSION = '0.01';
10              
11             require XSLoader;
12             XSLoader::load('Syntax::Infix::OptionalChain', $VERSION);
13              
14             sub import {
15 3     3   2289 Infix::Custom->import(
16             op => '?->',
17             call => \&_nav,
18             method => 1,
19             prec => 'mul', # binds tightly and left-associatively, so it chains
20             );
21             }
22              
23             sub unimport {
24 0     0     Infix::Custom->unimport('?->');
25             }
26              
27             1;
28              
29             __END__