File Coverage

blib/lib/AtteanX/Parser/Turtle/Constants.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 1 1 100.0
total 28 28 100.0


line stmt bran cond sub pod time code
1             # AtteanX::Parser::Turtle::Constants
2             # -----------------------------------------------------------------------------
3              
4             =head1 NAME
5              
6             AtteanX::Parser::Turtle::Constants - Constant definitions for use in parsing Turtle, TriG, and N-Triples
7              
8             =head1 VERSION
9              
10             This document describes AtteanX::Parser::Turtle::Constants version 0.033
11              
12             =head1 SYNOPSIS
13              
14             use AtteanX::Parser::Turtle::Constants;
15              
16             =head1 METHODS
17              
18             =over 4
19              
20             =cut
21              
22             use v5.14;
23 50     50   487 use warnings;
  50         129  
24 50     50   223  
  50         102  
  50         3206  
25             our @EXPORT;
26             BEGIN {
27             @EXPORT = qw(
28 50     50   1428 A
29             BASE
30             BNODE
31             BOOLEAN
32             COMMA
33             COMMENT
34             DECIMAL
35             DOT
36             DOUBLE
37             EQUALS
38             HATHAT
39             INTEGER
40             IRI
41             LANG
42             LBRACE
43             LBRACKET
44             LPAREN
45             GRAPH
46             PREFIX
47             PREFIXNAME
48             RBRACE
49             RBRACKET
50             RPAREN
51             SEMICOLON
52             STRING1D
53             STRING1S
54             STRING3D
55             STRING3S
56             TURTLEBASE
57             TURTLEPREFIX
58             GTGT
59             LTLT
60             LANNOT
61             RANNOT
62             WS
63             decrypt_constant
64             )
65             };
66             use base 'Exporter';
67 50     50   279  
  50         115  
  50         7772  
68             {
69             my %mapping;
70             my %reverse;
71             BEGIN {
72             my $cx = 0;
73 50     50   164 foreach my $name (grep { $_ ne 'decrypt_constant' } @EXPORT) {
74 50         112 my $value = ++$cx;
  1800         2217  
75 1750         1809 $reverse{ $value } = $name;
76 1750         3145 $mapping{ $name } = $value;
77 1750         5080 }
78             }
79             use constant +{ %mapping };
80 50     50   288  
  50         99  
  50         15662  
81             =item C<< decrypt_constant ( $type ) >>
82              
83             Returns the token name for the given token type.
84              
85             =cut
86              
87             }
88 829     829 1 933 }
  829         1318  
89              
90             1;
91              
92              
93             =back
94              
95             =head1 BUGS
96              
97             Please report any bugs or feature requests to through the GitHub web interface
98             at L<https://github.com/kasei/perlrdf/issues>.
99              
100             =head1 AUTHOR
101              
102             Toby Inkster C<< <tobyink@cpan.org> >>
103              
104             =head1 COPYRIGHT
105              
106             Copyright (c) 2014--2022 Toby Inkster. This
107             program is free software; you can redistribute it and/or modify it under
108             the same terms as Perl itself.
109              
110             =cut