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