File Coverage

blib/lib/Pegex/JSON/Grammar.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 11 11 100.0


line stmt bran cond sub pod time code
1             package Pegex::JSON::Grammar;
2 2     2   14 use Pegex::Base;
  2         4  
  2         13  
3             extends 'Pegex::Grammar';
4              
5 2     2   2617 use constant file => '../json-pgx/json.pgx';
  2         4  
  2         1129  
6              
7             sub make_tree { # Generated/Inlined by Pegex::Grammar (0.73)
8             {
9 3     3 1 850 '+grammar' => 'json',
10             '+include' => 'pegex-atoms',
11             '+toprule' => 'json',
12             '+version' => '0.0.1',
13             '_' => {
14             '.rgx' => qr/\G\s*/
15             },
16             'array' => {
17             '.all' => [
18             {
19             '-skip' => 1,
20             '.rgx' => qr/\G\s*\[\s*/
21             },
22             {
23             '+max' => 1,
24             '.all' => [
25             {
26             '.ref' => 'value'
27             },
28             {
29             '+min' => 0,
30             '-flat' => 1,
31             '.all' => [
32             {
33             '-skip' => 1,
34             '.rgx' => qr/\G\s*,\s*/
35             },
36             {
37             '.ref' => 'value'
38             }
39             ]
40             }
41             ]
42             },
43             {
44             '-skip' => 1,
45             '.rgx' => qr/\G\s*\]\s*/
46             }
47             ]
48             },
49             'false' => {
50             '.rgx' => qr/\Gfalse/
51             },
52             'json' => {
53             '.all' => [
54             {
55             '.ref' => '_'
56             },
57             {
58             '.ref' => 'value'
59             },
60             {
61             '.ref' => '_'
62             }
63             ]
64             },
65             'null' => {
66             '.rgx' => qr/\Gnull/
67             },
68             'number' => {
69             '.rgx' => qr/\G(\-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][\-\+]?[0-9]+)?)/
70             },
71             'object' => {
72             '.all' => [
73             {
74             '-skip' => 1,
75             '.rgx' => qr/\G\s*\{\s*/
76             },
77             {
78             '+max' => 1,
79             '.all' => [
80             {
81             '.ref' => 'pair'
82             },
83             {
84             '+min' => 0,
85             '-flat' => 1,
86             '.all' => [
87             {
88             '.rgx' => qr/\G\s*,\s*/
89             },
90             {
91             '.ref' => 'pair'
92             }
93             ]
94             }
95             ]
96             },
97             {
98             '-skip' => 1,
99             '.rgx' => qr/\G\s*\}\s*/
100             }
101             ]
102             },
103             'pair' => {
104             '.all' => [
105             {
106             '.ref' => 'string'
107             },
108             {
109             '-skip' => 1,
110             '.rgx' => qr/\G\s*:\s*/
111             },
112             {
113             '.ref' => 'value'
114             }
115             ]
116             },
117             'string' => {
118             '.rgx' => qr/\G"((?:\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})|[^"\x00-\x1f\\])*)"/
119             },
120             'true' => {
121             '.rgx' => qr/\Gtrue/
122             },
123             'value' => {
124             '.any' => [
125             {
126             '.ref' => 'string'
127             },
128             {
129             '.ref' => 'number'
130             },
131             {
132             '.ref' => 'object'
133             },
134             {
135             '.ref' => 'array'
136             },
137             {
138             '.ref' => 'true'
139             },
140             {
141             '.ref' => 'false'
142             },
143             {
144             '.ref' => 'null'
145             }
146             ]
147             }
148             }
149             }
150              
151             1;