File Coverage

blib/lib/Devel/Optic/Lens/Perlish/Constants.pm
Criterion Covered Total %
statement 22 22 100.0
branch 1 2 50.0
condition n/a
subroutine 7 7 100.0
pod n/a
total 30 31 96.7


line stmt bran cond sub pod time code
1             package Devel::Optic::Lens::Perlish::Constants;
2             $Devel::Optic::Lens::Perlish::Constants::VERSION = '0.015';
3             # ABSTRACT: Useful constants for the Perlish lens
4              
5 4     4   179840 use strict;
  4         11  
  4         90  
6 4     4   17 use warnings;
  4         5  
  4         87  
7              
8 4     4   13 use Exporter qw(import);
  4         7  
  4         138  
9              
10             use constant {
11 4 50       634 DEBUG => $ENV{DEVEL_OPTIC_DEBUG} ? 1 : 0
12 4     4   20 };
  4         13  
13              
14             my %ast_nodes;
15             my %interpreter;
16             BEGIN {
17 4     4   26 %ast_nodes = (
18             OP_ACCESS => DEBUG ? "OP_ACCESS" : 1,
19             OP_HASHKEY => DEBUG ? "OP_HASHKEY" : 2,
20             OP_ARRAYINDEX => DEBUG ? "OP_ARRAYINDEX" : 3,
21             SYMBOL => DEBUG ? "SYMBOL" : 4,
22             STRING => DEBUG ? "STRING" : 5,
23             NUMBER => DEBUG ? "NUMBER" : 6,
24             );
25              
26 4         22 %interpreter = (
27             NODE_TYPE => 0,
28             NODE_PAYLOAD => 1,
29             RAW_DATA_SAMPLE_SIZE => 10,
30             );
31              
32 4         23 our @EXPORT_OK = (keys %ast_nodes, keys %interpreter);
33 4         105 our %EXPORT_TAGS = (
34             all => [keys %ast_nodes, keys %interpreter],
35             );
36             }
37              
38 4     4   20 use constant \%ast_nodes;
  4         22  
  4         302  
39 4     4   33 use constant \%interpreter;
  4         7  
  4         227  
40              
41             1;
42              
43             __END__