File Coverage

blib/lib/Query/Tags/Grammar.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Query::Tags::Grammar;
2              
3 5     5   468435 use strict;
  5         14  
  5         222  
4 5     5   48 use base 'Pegex::Grammar';
  5         11  
  5         2701  
5 5     5   18298 use constant file => './share/query-tags.pgx';
  5         12  
  5         4300  
6              
7             sub make_tree { # Generated/Inlined by Pegex::Grammar (0.75)
8             {
9 14     14 1 480440 '+grammar' => 'query-tags',
10             '+include' => 'pegex-atoms',
11             '+toprule' => 'query',
12             '+version' => '0.0.1',
13             'LANGLE' => {
14             '.rgx' => qr/\G
15             },
16             'RANGLE' => {
17             '.rgx' => qr/\G\>/
18             },
19             '_' => {
20             '.rgx' => qr/\G\s*/
21             },
22             'bareword' => {
23             '.rgx' => qr/\G((?:\w|[0-9]|[\-\._])+)/
24             },
25             'junction' => {
26             '.all' => [
27             {
28             '.rgx' => qr/\G([\~]?)/
29             },
30             {
31             '.rgx' => qr/\G([\!\|\&])/
32             },
33             {
34             '.ref' => 'list'
35             }
36             ]
37             },
38             'key' => {
39             '.rgx' => qr/\G([a-zA-Z._-][a-zA-Z0-9._-]*)/
40             },
41             'list' => {
42             '.all' => [
43             {
44             '-skip' => 1,
45             '.ref' => 'LANGLE'
46             },
47             {
48             '.all' => [
49             {
50             '.ref' => 'value'
51             },
52             {
53             '+min' => 0,
54             '-flat' => 1,
55             '.all' => [
56             {
57             '-skip' => 1,
58             '.rgx' => qr/\G\s*/
59             },
60             {
61             '.ref' => 'value'
62             }
63             ]
64             }
65             ]
66             },
67             {
68             '-skip' => 1,
69             '.ref' => 'RANGLE'
70             }
71             ]
72             },
73             'pair' => {
74             '.all' => [
75             {
76             '.ref' => '_'
77             },
78             {
79             '.rgx' => qr/\G:/
80             },
81             {
82             '.ref' => 'key'
83             },
84             {
85             '+max' => 1,
86             '.any' => [
87             {
88             '.ref' => 'qmark'
89             },
90             {
91             '.ref' => 'quoted_value'
92             }
93             ]
94             }
95             ]
96             },
97             'qmark' => {
98             '.rgx' => qr/\G(\?)/
99             },
100             'query' => {
101             '.all' => [
102             {
103             '.ref' => '_'
104             },
105             {
106             '.all' => [
107             {
108             '.any' => [
109             {
110             '.ref' => 'pair'
111             },
112             {
113             '.ref' => 'string'
114             },
115             {
116             '.ref' => 'regex'
117             },
118             {
119             '.ref' => 'bareword'
120             }
121             ]
122             },
123             {
124             '+min' => 0,
125             '-flat' => 1,
126             '.all' => [
127             {
128             '-skip' => 1,
129             '.rgx' => qr/\G\s*/
130             },
131             {
132             '.any' => [
133             {
134             '.ref' => 'pair'
135             },
136             {
137             '.ref' => 'string'
138             },
139             {
140             '.ref' => 'regex'
141             },
142             {
143             '.ref' => 'bareword'
144             }
145             ]
146             }
147             ]
148             }
149             ]
150             },
151             {
152             '.ref' => '_'
153             }
154             ]
155             },
156             'quoted_value' => {
157             '.any' => [
158             {
159             '.ref' => 'string'
160             },
161             {
162             '.ref' => 'regex'
163             },
164             {
165             '.ref' => 'junction'
166             }
167             ]
168             },
169             'regex' => {
170             '.rgx' => qr/\G\/((?:|\\\/|[^\/])+)\//
171             },
172             'string' => {
173             '.rgx' => qr/\G'((?:|\\(?:|['\\\/bfnrt]|u[0-9a-fA-F]{4})|[^'\x00-\x1f\\])*)'/
174             },
175             'value' => {
176             '.any' => [
177             {
178             '.ref' => 'quoted_value'
179             },
180             {
181             '.ref' => 'bareword'
182             }
183             ]
184             }
185             }
186             }
187              
188             1;