JSONY/Grammar.pm

filter: Statementstmt 100% 8 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 12 / 12 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
make_tree
1.0
CRAP 1.0
« JSONY.pm ↑ Summary
1 package JSONY::Grammar;
2 6 ▶use base 'Pegex::Grammar';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 6 ▶use constant file => './share/jsony.pgx';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 sub make_tree { # Generated/Inlined by Pegex::Grammar (0.73)
7 {
8 36 ▶ '+grammar' => 'jsony',
Subroutine make_tree: called CC=1 SCAR=0.0
Pod documented
9 '+toprule' => 'jsony',
10 '+version' => '0.0.1',
11 'EOL' => {
12 '.rgx' => qr/\G\r?\n/
13 },
14 '_' => {
15 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
16 },
17 'bare' => {
18 '.rgx' => qr/\G([^\s\{\}\[\]'",]*[^\s\{\}\[\]'",:])/
19 },
20 'comment' => {
21 '.rgx' => qr/\G(?:\#\ .*|\#|\ *)(?:\r?\n|\z)/
22 },
23 'double' => {
24 '.rgx' => qr/\G"((?:\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})|[^"\x00-\x1f])*)"/
25 },
26 'jsony' => {
27 '.any' => [
28 {
29 '.ref' => 'seq'
30 },
31 {
32 '.ref' => 'map'
33 },
34 {
35 '.ref' => 'top_seq'
36 },
37 {
38 '.ref' => 'top_map'
39 },
40 {
41 '.ref' => 'list'
42 }
43 ]
44 },
45 'list' => {
46 '+max' => 1,
47 '.all' => [
48 {
49 '.ref' => 'node'
50 },
51 {
52 '+min' => 0,
53 '-flat' => 1,
54 '.all' => [
55 {
56 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*,?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
57 },
58 {
59 '.ref' => 'node'
60 }
61 ]
62 },
63 {
64 '+max' => 1,
65 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*,?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
66 }
67 ]
68 },
69 'map' => {
70 '.all' => [
71 {
72 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*\{(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
73 },
74 {
75 '+min' => 0,
76 '.ref' => 'pair'
77 },
78 {
79 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*\}(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
80 }
81 ]
82 },
83 'node' => {
84 '.any' => [
85 {
86 '.ref' => 'map'
87 },
88 {
89 '.ref' => 'seq'
90 },
91 {
92 '.ref' => 'scalar'
93 }
94 ]
95 },
96 'pair' => {
97 '.all' => [
98 {
99 '.ref' => 'string'
100 },
101 {
102 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*:?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
103 },
104 {
105 '.ref' => 'node'
106 },
107 {
108 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*,?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
109 }
110 ]
111 },
112 'scalar' => {
113 '.any' => [
114 {
115 '.ref' => 'double'
116 },
117 {
118 '.ref' => 'single'
119 },
120 {
121 '.ref' => 'bare'
122 }
123 ]
124 },
125 'seq' => {
126 '.all' => [
127 {
128 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*\[(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
129 },
130 {
131 '+max' => 1,
132 '.all' => [
133 {
134 '.ref' => 'node'
135 },
136 {
137 '+min' => 0,
138 '-flat' => 1,
139 '.all' => [
140 {
141 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*,?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
142 },
143 {
144 '.ref' => 'node'
145 }
146 ]
147 },
148 {
149 '+max' => 1,
150 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*,?(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
151 }
152 ]
153 },
154 {
155 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*\](?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
156 }
157 ]
158 },
159 'single' => {
160 '.rgx' => qr/\G'([^']*)'/
161 },
162 'string' => {
163 '.ref' => 'scalar'
164 },
165 'top_map' => {
166 '+min' => 1,
167 '.all' => [
168 {
169 '.ref' => 'string'
170 },
171 {
172 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*:(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*/
173 },
174 {
175 '.ref' => 'node'
176 },
177 {
178 '.ref' => '_'
179 }
180 ]
181 },
182 'top_seq' => {
183 '+min' => 1,
184 '.ref' => 'top_seq_entry'
185 },
186 'top_seq_entry' => {
187 '.all' => [
188 {
189 '.rgx' => qr/\G(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*\-\ +/
190 },
191 {
192 '.all' => [
193 {
194 '+max' => 1,
195 '.all' => [
196 {
197 '.ref' => 'node'
198 },
199 {
200 '+min' => 0,
201 '-flat' => 1,
202 '.all' => [
203 {
204 '.rgx' => qr/\G(?:\ *,\ *\r?\n(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*|\ +)/
205 },
206 {
207 '.ref' => 'node'
208 }
209 ]
210 },
211 {
212 '+max' => 1,
213 '.rgx' => qr/\G(?:\ *,\ *\r?\n(?:\s|(?:\#\ .*|\#|\ *)(?:\r?\n|\z))*|\ +)/
214 }
215 ]
216 },
217 {
218 '.any' => [
219 {
220 '.ref' => 'comment'
221 },
222 {
223 '.ref' => 'EOL'
224 }
225 ]
226 }
227 ]
228 }
229 ]
230 }
231 }
232 }
233  
234 6 1;
« JSONY.pm ↑ Summary