File Coverage

blib/lib/PPIx/QuoteLike/Constant.pm
Criterion Covered Total %
statement 53 54 98.1
branch n/a
condition n/a
subroutine 17 17 100.0
pod n/a
total 70 71 98.5


line stmt bran cond sub pod time code
1             package PPIx::QuoteLike::Constant;
2              
3 8     8   158606 use 5.006;
  8         68  
4              
5 8     8   38 use strict;
  8         11  
  8         132  
6 8     8   29 use warnings;
  8         21  
  8         177  
7              
8 8     8   35 use Carp;
  8         11  
  8         440  
9 8     8   51 use base qw{ Exporter };
  8         22  
  8         1110  
10              
11             our $VERSION = '0.022_01';
12              
13 8     8   49 no warnings qw{ once }; # For older Perls.
  8         20  
  8         552  
14              
15             our @CARP_NOT = qw{
16             PPIx::QuoteLike
17             PPIx::QuoteLike::Constant
18             PPIx::QuoteLike::Dumper
19             PPIx::QuoteLike::Token
20             PPIx::QuoteLike::Token::Control
21             PPIx::QuoteLike::Token::Delimiter
22             PPIx::QuoteLike::Token::Interpolation
23             PPIx::QuoteLike::Token::String
24             PPIx::QuoteLike::Token::Structure
25             PPIx::QuoteLike::Token::Unknown
26             PPIx::QuoteLike::Token::Whitespace
27             PPIx::QuoteLike::Utils
28             };
29              
30 8     8   45 use warnings qw{ once };
  8         19  
  8         546  
31              
32             our @EXPORT_OK = qw{
33             ARRAY_REF
34             MINIMUM_PERL
35             HAVE_PPIX_REGEXP
36             LOCATION_LINE
37             LOCATION_CHARACTER
38             LOCATION_COLUMN
39             LOCATION_LOGICAL_LINE
40             LOCATION_LOGICAL_FILE
41             SUFFICIENT_UTF8_SUPPORT_FOR_WEIRD_DELIMITERS
42             VARIABLE_RE
43             @CARP_NOT
44             };
45              
46 8     8   46 use constant ARRAY_REF => ref [];
  8         13  
  8         803  
47              
48             # We can't depend on PPIx::Regexp without getting into a circular
49             # dependency. I think. But we can sure use it if we can come by it.
50 8         23 use constant HAVE_PPIX_REGEXP => do {
51 8         16 local $@ = undef;
52 8         15 eval { ## no critic (RequireCheckingReturnValueOfEval)
53 8         1488 require PPIx::Regexp;
54 0         0 1;
55             };
56 8     8   44 };
  8         13  
57              
58             # The '## VERBATIM' annotations support test xt/author/verbatim.t
59             ## VERBATIM EXPECT 1
60             ## VERBATIM BEGIN PPI::Document
61 8     8   36 use constant LOCATION_LINE => 0;
  8         15  
  8         394  
62 8     8   50 use constant LOCATION_CHARACTER => 1;
  8         12  
  8         340  
63 8     8   42 use constant LOCATION_COLUMN => 2;
  8         23  
  8         380  
64 8     8   39 use constant LOCATION_LOGICAL_LINE => 3;
  8         13  
  8         362  
65 8     8   43 use constant LOCATION_LOGICAL_FILE => 4;
  8         19  
  8         385  
66             ## VERBATIM END
67              
68 8     8   42 use constant MINIMUM_PERL => '5.000';
  8         67  
  8         398  
69              
70 8     8   43 use constant SUFFICIENT_UTF8_SUPPORT_FOR_WEIRD_DELIMITERS => $] ge '5.008003';
  8         50  
  8         1503  
71              
72             # Match the name of a variable. The user of this needs to anchor it
73             # right after the sigil. The line noise is [[:punct:]] as documented in
74             # perlrecharclass, less anything that needs to be excluded (currently
75             # only '@' and '*').
76 8         439 use constant VARIABLE_RE => qr/
77             [[:alpha:]_]\w* (?: :: [[:alpha:]_] \w* )* |
78             \^ [A-Z_] |
79             [0-9]+ |
80             [-!"#\$%&'()+,.\/:;<=>?[\\\]^_`{|}~]
81 8     8   47 /smx;
  8         14  
82              
83             1;
84              
85             __END__