line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::Transform::Grammar; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
68
|
|
5
|
2
|
|
|
2
|
|
12
|
use base 'Pegex::Grammar'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
835
|
|
6
|
2
|
|
|
2
|
|
5106
|
use constant file => './json-transform.pgx'; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
4320
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
JSON::Transform::Grammar - JSON::Transform grammar |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use Pegex::Parser; |
15
|
|
|
|
|
|
|
use JSON::Transform::Grammar; |
16
|
|
|
|
|
|
|
use Pegex::Tree::Wrap; |
17
|
|
|
|
|
|
|
use Pegex::Input; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $parser = Pegex::Parser->new( |
20
|
|
|
|
|
|
|
grammar => JSON::Transform::Grammar->new, |
21
|
|
|
|
|
|
|
receiver => Pegex::Tree::Wrap->new, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
my $text = '"" <% [ $V+`id`:$K ]'; |
24
|
|
|
|
|
|
|
my $input = Pegex::Input->new(string => $text); |
25
|
|
|
|
|
|
|
my $got = $parser->parse($input); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 DESCRIPTION |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
This is a subclass of L, with the JSON::Transform grammar. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 METHODS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 make_tree |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Override method from L. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub make_tree { # Generated/Inlined by Pegex::Grammar (0.67) |
40
|
|
|
|
|
|
|
{ |
41
|
2
|
|
|
2
|
1
|
693
|
'+grammar' => 'json-transform', |
42
|
|
|
|
|
|
|
'+include' => 'pegex-atoms', |
43
|
|
|
|
|
|
|
'+toprule' => 'transforms', |
44
|
|
|
|
|
|
|
'+version' => '0.01', |
45
|
|
|
|
|
|
|
'BACK' => { |
46
|
|
|
|
|
|
|
'.rgx' => qr/\G\\/ |
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
'colonPair' => { |
49
|
|
|
|
|
|
|
'.all' => [ |
50
|
|
|
|
|
|
|
{ |
51
|
|
|
|
|
|
|
'-flat' => 1, |
52
|
|
|
|
|
|
|
'.ref' => 'exprStringValue' |
53
|
|
|
|
|
|
|
}, |
54
|
|
|
|
|
|
|
{ |
55
|
|
|
|
|
|
|
'-skip' => 1, |
56
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*:(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
57
|
|
|
|
|
|
|
}, |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
'.ref' => 'exprSingleValue' |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
] |
62
|
|
|
|
|
|
|
}, |
63
|
|
|
|
|
|
|
'exprApplyJsonPointer' => { |
64
|
|
|
|
|
|
|
'.all' => [ |
65
|
|
|
|
|
|
|
{ |
66
|
|
|
|
|
|
|
'-skip' => 1, |
67
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*<(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
68
|
|
|
|
|
|
|
}, |
69
|
|
|
|
|
|
|
{ |
70
|
|
|
|
|
|
|
'.ref' => 'jsonPointer' |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
] |
73
|
|
|
|
|
|
|
}, |
74
|
|
|
|
|
|
|
'exprArrayLiteral' => { |
75
|
|
|
|
|
|
|
'.all' => [ |
76
|
|
|
|
|
|
|
{ |
77
|
|
|
|
|
|
|
'-skip' => 1, |
78
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\.\[(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
79
|
|
|
|
|
|
|
}, |
80
|
|
|
|
|
|
|
{ |
81
|
|
|
|
|
|
|
'+max' => 1, |
82
|
|
|
|
|
|
|
'.all' => [ |
83
|
|
|
|
|
|
|
{ |
84
|
|
|
|
|
|
|
'.ref' => 'exprSingleValue' |
85
|
|
|
|
|
|
|
}, |
86
|
|
|
|
|
|
|
{ |
87
|
|
|
|
|
|
|
'+min' => 0, |
88
|
|
|
|
|
|
|
'-flat' => 1, |
89
|
|
|
|
|
|
|
'.all' => [ |
90
|
|
|
|
|
|
|
{ |
91
|
|
|
|
|
|
|
'-skip' => 1, |
92
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*,(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
93
|
|
|
|
|
|
|
}, |
94
|
|
|
|
|
|
|
{ |
95
|
|
|
|
|
|
|
'.ref' => 'exprSingleValue' |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
] |
98
|
|
|
|
|
|
|
}, |
99
|
|
|
|
|
|
|
{ |
100
|
|
|
|
|
|
|
'+max' => 1, |
101
|
|
|
|
|
|
|
'-skip' => 1, |
102
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*,(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
] |
105
|
|
|
|
|
|
|
}, |
106
|
|
|
|
|
|
|
{ |
107
|
|
|
|
|
|
|
'-skip' => 1, |
108
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\](?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
] |
111
|
|
|
|
|
|
|
}, |
112
|
|
|
|
|
|
|
'exprArrayMapping' => { |
113
|
|
|
|
|
|
|
'.all' => [ |
114
|
|
|
|
|
|
|
{ |
115
|
|
|
|
|
|
|
'-skip' => 1, |
116
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\[(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
117
|
|
|
|
|
|
|
}, |
118
|
|
|
|
|
|
|
{ |
119
|
|
|
|
|
|
|
'.ref' => 'exprSingleValue' |
120
|
|
|
|
|
|
|
}, |
121
|
|
|
|
|
|
|
{ |
122
|
|
|
|
|
|
|
'-skip' => 1, |
123
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\](?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
] |
126
|
|
|
|
|
|
|
}, |
127
|
|
|
|
|
|
|
'exprKeyAdd' => { |
128
|
|
|
|
|
|
|
'.all' => [ |
129
|
|
|
|
|
|
|
{ |
130
|
|
|
|
|
|
|
'-skip' => 1, |
131
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\@(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
132
|
|
|
|
|
|
|
}, |
133
|
|
|
|
|
|
|
{ |
134
|
|
|
|
|
|
|
'-flat' => 1, |
135
|
|
|
|
|
|
|
'.ref' => 'colonPair' |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
] |
138
|
|
|
|
|
|
|
}, |
139
|
|
|
|
|
|
|
'exprKeyRemove' => { |
140
|
|
|
|
|
|
|
'.all' => [ |
141
|
|
|
|
|
|
|
{ |
142
|
|
|
|
|
|
|
'-skip' => 1, |
143
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\#(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
144
|
|
|
|
|
|
|
}, |
145
|
|
|
|
|
|
|
{ |
146
|
|
|
|
|
|
|
'-flat' => 1, |
147
|
|
|
|
|
|
|
'.ref' => 'exprStringValue' |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
] |
150
|
|
|
|
|
|
|
}, |
151
|
|
|
|
|
|
|
'exprMapping' => { |
152
|
|
|
|
|
|
|
'.all' => [ |
153
|
|
|
|
|
|
|
{ |
154
|
|
|
|
|
|
|
'-wrap' => 1, |
155
|
|
|
|
|
|
|
'.ref' => 'opFrom' |
156
|
|
|
|
|
|
|
}, |
157
|
|
|
|
|
|
|
{ |
158
|
|
|
|
|
|
|
'.any' => [ |
159
|
|
|
|
|
|
|
{ |
160
|
|
|
|
|
|
|
'.ref' => 'exprArrayMapping' |
161
|
|
|
|
|
|
|
}, |
162
|
|
|
|
|
|
|
{ |
163
|
|
|
|
|
|
|
'.ref' => 'exprObjectMapping' |
164
|
|
|
|
|
|
|
}, |
165
|
|
|
|
|
|
|
{ |
166
|
|
|
|
|
|
|
'.ref' => 'exprSingleValue' |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
] |
169
|
|
|
|
|
|
|
} |
170
|
|
|
|
|
|
|
] |
171
|
|
|
|
|
|
|
}, |
172
|
|
|
|
|
|
|
'exprObjectLiteral' => { |
173
|
|
|
|
|
|
|
'.all' => [ |
174
|
|
|
|
|
|
|
{ |
175
|
|
|
|
|
|
|
'-skip' => 1, |
176
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\.\{(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
177
|
|
|
|
|
|
|
}, |
178
|
|
|
|
|
|
|
{ |
179
|
|
|
|
|
|
|
'+max' => 1, |
180
|
|
|
|
|
|
|
'.all' => [ |
181
|
|
|
|
|
|
|
{ |
182
|
|
|
|
|
|
|
'.ref' => 'colonPair' |
183
|
|
|
|
|
|
|
}, |
184
|
|
|
|
|
|
|
{ |
185
|
|
|
|
|
|
|
'+min' => 0, |
186
|
|
|
|
|
|
|
'-flat' => 1, |
187
|
|
|
|
|
|
|
'.all' => [ |
188
|
|
|
|
|
|
|
{ |
189
|
|
|
|
|
|
|
'-skip' => 1, |
190
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*,(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
191
|
|
|
|
|
|
|
}, |
192
|
|
|
|
|
|
|
{ |
193
|
|
|
|
|
|
|
'.ref' => 'colonPair' |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
] |
196
|
|
|
|
|
|
|
}, |
197
|
|
|
|
|
|
|
{ |
198
|
|
|
|
|
|
|
'+max' => 1, |
199
|
|
|
|
|
|
|
'-skip' => 1, |
200
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*,(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
] |
203
|
|
|
|
|
|
|
}, |
204
|
|
|
|
|
|
|
{ |
205
|
|
|
|
|
|
|
'-skip' => 1, |
206
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\}(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
207
|
|
|
|
|
|
|
} |
208
|
|
|
|
|
|
|
] |
209
|
|
|
|
|
|
|
}, |
210
|
|
|
|
|
|
|
'exprObjectMapping' => { |
211
|
|
|
|
|
|
|
'.all' => [ |
212
|
|
|
|
|
|
|
{ |
213
|
|
|
|
|
|
|
'-skip' => 1, |
214
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\{(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
215
|
|
|
|
|
|
|
}, |
216
|
|
|
|
|
|
|
{ |
217
|
|
|
|
|
|
|
'-flat' => 1, |
218
|
|
|
|
|
|
|
'.ref' => 'colonPair' |
219
|
|
|
|
|
|
|
}, |
220
|
|
|
|
|
|
|
{ |
221
|
|
|
|
|
|
|
'-skip' => 1, |
222
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\}(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
] |
225
|
|
|
|
|
|
|
}, |
226
|
|
|
|
|
|
|
'exprSingleValue' => { |
227
|
|
|
|
|
|
|
'.all' => [ |
228
|
|
|
|
|
|
|
{ |
229
|
|
|
|
|
|
|
'.any' => [ |
230
|
|
|
|
|
|
|
{ |
231
|
|
|
|
|
|
|
'.ref' => 'jsonPointer' |
232
|
|
|
|
|
|
|
}, |
233
|
|
|
|
|
|
|
{ |
234
|
|
|
|
|
|
|
'.ref' => 'variableUser' |
235
|
|
|
|
|
|
|
}, |
236
|
|
|
|
|
|
|
{ |
237
|
|
|
|
|
|
|
'.ref' => 'variableSystem' |
238
|
|
|
|
|
|
|
}, |
239
|
|
|
|
|
|
|
{ |
240
|
|
|
|
|
|
|
'.ref' => 'exprStringQuoted' |
241
|
|
|
|
|
|
|
}, |
242
|
|
|
|
|
|
|
{ |
243
|
|
|
|
|
|
|
'.ref' => 'exprArrayLiteral' |
244
|
|
|
|
|
|
|
}, |
245
|
|
|
|
|
|
|
{ |
246
|
|
|
|
|
|
|
'.ref' => 'exprObjectLiteral' |
247
|
|
|
|
|
|
|
} |
248
|
|
|
|
|
|
|
] |
249
|
|
|
|
|
|
|
}, |
250
|
|
|
|
|
|
|
{ |
251
|
|
|
|
|
|
|
'+max' => 1, |
252
|
|
|
|
|
|
|
'-flat' => 1, |
253
|
|
|
|
|
|
|
'.ref' => 'singleValueMod' |
254
|
|
|
|
|
|
|
} |
255
|
|
|
|
|
|
|
] |
256
|
|
|
|
|
|
|
}, |
257
|
|
|
|
|
|
|
'exprStringQuoted' => { |
258
|
|
|
|
|
|
|
'.all' => [ |
259
|
|
|
|
|
|
|
{ |
260
|
|
|
|
|
|
|
'-skip' => 1, |
261
|
|
|
|
|
|
|
'.rgx' => qr/\G`/ |
262
|
|
|
|
|
|
|
}, |
263
|
|
|
|
|
|
|
{ |
264
|
|
|
|
|
|
|
'+min' => 0, |
265
|
|
|
|
|
|
|
'.any' => [ |
266
|
|
|
|
|
|
|
{ |
267
|
|
|
|
|
|
|
'-flat' => 1, |
268
|
|
|
|
|
|
|
'.ref' => 'stringValueCommon' |
269
|
|
|
|
|
|
|
}, |
270
|
|
|
|
|
|
|
{ |
271
|
|
|
|
|
|
|
'.ref' => 'jsonBackslashGrave' |
272
|
|
|
|
|
|
|
}, |
273
|
|
|
|
|
|
|
{ |
274
|
|
|
|
|
|
|
'.ref' => 'jsonOtherNotGrave' |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
] |
277
|
|
|
|
|
|
|
}, |
278
|
|
|
|
|
|
|
{ |
279
|
|
|
|
|
|
|
'-skip' => 1, |
280
|
|
|
|
|
|
|
'.rgx' => qr/\G`/ |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
] |
283
|
|
|
|
|
|
|
}, |
284
|
|
|
|
|
|
|
'exprStringValue' => { |
285
|
|
|
|
|
|
|
'.any' => [ |
286
|
|
|
|
|
|
|
{ |
287
|
|
|
|
|
|
|
'.ref' => 'jsonPointer' |
288
|
|
|
|
|
|
|
}, |
289
|
|
|
|
|
|
|
{ |
290
|
|
|
|
|
|
|
'.ref' => 'variableUser' |
291
|
|
|
|
|
|
|
}, |
292
|
|
|
|
|
|
|
{ |
293
|
|
|
|
|
|
|
'.ref' => 'variableSystem' |
294
|
|
|
|
|
|
|
}, |
295
|
|
|
|
|
|
|
{ |
296
|
|
|
|
|
|
|
'.ref' => 'exprStringQuoted' |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
] |
299
|
|
|
|
|
|
|
}, |
300
|
|
|
|
|
|
|
'jsonBackslashDollar' => { |
301
|
|
|
|
|
|
|
'.all' => [ |
302
|
|
|
|
|
|
|
{ |
303
|
|
|
|
|
|
|
'-skip' => 1, |
304
|
|
|
|
|
|
|
'.ref' => 'BACK' |
305
|
|
|
|
|
|
|
}, |
306
|
|
|
|
|
|
|
{ |
307
|
|
|
|
|
|
|
'.rgx' => qr/\G(\$)/ |
308
|
|
|
|
|
|
|
} |
309
|
|
|
|
|
|
|
] |
310
|
|
|
|
|
|
|
}, |
311
|
|
|
|
|
|
|
'jsonBackslashDouble' => { |
312
|
|
|
|
|
|
|
'.all' => [ |
313
|
|
|
|
|
|
|
{ |
314
|
|
|
|
|
|
|
'-skip' => 1, |
315
|
|
|
|
|
|
|
'.ref' => 'BACK' |
316
|
|
|
|
|
|
|
}, |
317
|
|
|
|
|
|
|
{ |
318
|
|
|
|
|
|
|
'.rgx' => qr/\G(")/ |
319
|
|
|
|
|
|
|
} |
320
|
|
|
|
|
|
|
] |
321
|
|
|
|
|
|
|
}, |
322
|
|
|
|
|
|
|
'jsonBackslashGrave' => { |
323
|
|
|
|
|
|
|
'.all' => [ |
324
|
|
|
|
|
|
|
{ |
325
|
|
|
|
|
|
|
'-skip' => 1, |
326
|
|
|
|
|
|
|
'.ref' => 'BACK' |
327
|
|
|
|
|
|
|
}, |
328
|
|
|
|
|
|
|
{ |
329
|
|
|
|
|
|
|
'.rgx' => qr/\G(`)/ |
330
|
|
|
|
|
|
|
} |
331
|
|
|
|
|
|
|
] |
332
|
|
|
|
|
|
|
}, |
333
|
|
|
|
|
|
|
'jsonBackslashQuote' => { |
334
|
|
|
|
|
|
|
'.all' => [ |
335
|
|
|
|
|
|
|
{ |
336
|
|
|
|
|
|
|
'-skip' => 1, |
337
|
|
|
|
|
|
|
'.ref' => 'BACK' |
338
|
|
|
|
|
|
|
}, |
339
|
|
|
|
|
|
|
{ |
340
|
|
|
|
|
|
|
'.rgx' => qr/\G([\\\/bfnrt])/ |
341
|
|
|
|
|
|
|
} |
342
|
|
|
|
|
|
|
] |
343
|
|
|
|
|
|
|
}, |
344
|
|
|
|
|
|
|
'jsonOtherNotDouble' => { |
345
|
|
|
|
|
|
|
'.rgx' => qr/\G([^"\x00-\x1f\\\$]+)/ |
346
|
|
|
|
|
|
|
}, |
347
|
|
|
|
|
|
|
'jsonOtherNotGrave' => { |
348
|
|
|
|
|
|
|
'.rgx' => qr/\G([^`\x00-\x1f\\\$]+)/ |
349
|
|
|
|
|
|
|
}, |
350
|
|
|
|
|
|
|
'jsonPointer' => { |
351
|
|
|
|
|
|
|
'.all' => [ |
352
|
|
|
|
|
|
|
{ |
353
|
|
|
|
|
|
|
'-skip' => 1, |
354
|
|
|
|
|
|
|
'.rgx' => qr/\G"/ |
355
|
|
|
|
|
|
|
}, |
356
|
|
|
|
|
|
|
{ |
357
|
|
|
|
|
|
|
'+min' => 0, |
358
|
|
|
|
|
|
|
'.any' => [ |
359
|
|
|
|
|
|
|
{ |
360
|
|
|
|
|
|
|
'-flat' => 1, |
361
|
|
|
|
|
|
|
'.ref' => 'stringValueCommon' |
362
|
|
|
|
|
|
|
}, |
363
|
|
|
|
|
|
|
{ |
364
|
|
|
|
|
|
|
'.ref' => 'jsonBackslashDouble' |
365
|
|
|
|
|
|
|
}, |
366
|
|
|
|
|
|
|
{ |
367
|
|
|
|
|
|
|
'.ref' => 'jsonOtherNotDouble' |
368
|
|
|
|
|
|
|
} |
369
|
|
|
|
|
|
|
] |
370
|
|
|
|
|
|
|
}, |
371
|
|
|
|
|
|
|
{ |
372
|
|
|
|
|
|
|
'-skip' => 1, |
373
|
|
|
|
|
|
|
'.rgx' => qr/\G"/ |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
] |
376
|
|
|
|
|
|
|
}, |
377
|
|
|
|
|
|
|
'jsonUnicode' => { |
378
|
|
|
|
|
|
|
'.all' => [ |
379
|
|
|
|
|
|
|
{ |
380
|
|
|
|
|
|
|
'-skip' => 1, |
381
|
|
|
|
|
|
|
'.rgx' => qr/\G\\u/ |
382
|
|
|
|
|
|
|
}, |
383
|
|
|
|
|
|
|
{ |
384
|
|
|
|
|
|
|
'.rgx' => qr/\G([0-9a-fA-F]{4})/ |
385
|
|
|
|
|
|
|
} |
386
|
|
|
|
|
|
|
] |
387
|
|
|
|
|
|
|
}, |
388
|
|
|
|
|
|
|
'opArrayFrom' => { |
389
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*(<\@)(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
390
|
|
|
|
|
|
|
}, |
391
|
|
|
|
|
|
|
'opCopyFrom' => { |
392
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*(<\-)(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
393
|
|
|
|
|
|
|
}, |
394
|
|
|
|
|
|
|
'opFrom' => { |
395
|
|
|
|
|
|
|
'.any' => [ |
396
|
|
|
|
|
|
|
{ |
397
|
|
|
|
|
|
|
'.ref' => 'opArrayFrom' |
398
|
|
|
|
|
|
|
}, |
399
|
|
|
|
|
|
|
{ |
400
|
|
|
|
|
|
|
'.ref' => 'opObjectFrom' |
401
|
|
|
|
|
|
|
} |
402
|
|
|
|
|
|
|
] |
403
|
|
|
|
|
|
|
}, |
404
|
|
|
|
|
|
|
'opMoveFrom' => { |
405
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*(<<)(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
406
|
|
|
|
|
|
|
}, |
407
|
|
|
|
|
|
|
'opObjectFrom' => { |
408
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*(<%)(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
409
|
|
|
|
|
|
|
}, |
410
|
|
|
|
|
|
|
'singleValueMod' => { |
411
|
|
|
|
|
|
|
'.any' => [ |
412
|
|
|
|
|
|
|
{ |
413
|
|
|
|
|
|
|
'.ref' => 'exprKeyAdd' |
414
|
|
|
|
|
|
|
}, |
415
|
|
|
|
|
|
|
{ |
416
|
|
|
|
|
|
|
'.ref' => 'exprKeyRemove' |
417
|
|
|
|
|
|
|
}, |
418
|
|
|
|
|
|
|
{ |
419
|
|
|
|
|
|
|
'.ref' => 'exprApplyJsonPointer' |
420
|
|
|
|
|
|
|
} |
421
|
|
|
|
|
|
|
] |
422
|
|
|
|
|
|
|
}, |
423
|
|
|
|
|
|
|
'stringValueCommon' => { |
424
|
|
|
|
|
|
|
'.any' => [ |
425
|
|
|
|
|
|
|
{ |
426
|
|
|
|
|
|
|
'.ref' => 'jsonUnicode' |
427
|
|
|
|
|
|
|
}, |
428
|
|
|
|
|
|
|
{ |
429
|
|
|
|
|
|
|
'.ref' => 'jsonBackslashQuote' |
430
|
|
|
|
|
|
|
}, |
431
|
|
|
|
|
|
|
{ |
432
|
|
|
|
|
|
|
'.ref' => 'jsonBackslashDollar' |
433
|
|
|
|
|
|
|
}, |
434
|
|
|
|
|
|
|
{ |
435
|
|
|
|
|
|
|
'.ref' => 'variableUser' |
436
|
|
|
|
|
|
|
}, |
437
|
|
|
|
|
|
|
{ |
438
|
|
|
|
|
|
|
'.ref' => 'variableSystem' |
439
|
|
|
|
|
|
|
} |
440
|
|
|
|
|
|
|
] |
441
|
|
|
|
|
|
|
}, |
442
|
|
|
|
|
|
|
'transformCopy' => { |
443
|
|
|
|
|
|
|
'.all' => [ |
444
|
|
|
|
|
|
|
{ |
445
|
|
|
|
|
|
|
'.any' => [ |
446
|
|
|
|
|
|
|
{ |
447
|
|
|
|
|
|
|
'.ref' => 'jsonPointer' |
448
|
|
|
|
|
|
|
}, |
449
|
|
|
|
|
|
|
{ |
450
|
|
|
|
|
|
|
'.ref' => 'variableUser' |
451
|
|
|
|
|
|
|
} |
452
|
|
|
|
|
|
|
] |
453
|
|
|
|
|
|
|
}, |
454
|
|
|
|
|
|
|
{ |
455
|
|
|
|
|
|
|
'-skip' => 1, |
456
|
|
|
|
|
|
|
'.ref' => 'opCopyFrom' |
457
|
|
|
|
|
|
|
}, |
458
|
|
|
|
|
|
|
{ |
459
|
|
|
|
|
|
|
'.ref' => 'exprSingleValue' |
460
|
|
|
|
|
|
|
}, |
461
|
|
|
|
|
|
|
{ |
462
|
|
|
|
|
|
|
'+max' => 1, |
463
|
|
|
|
|
|
|
'.ref' => 'exprMapping' |
464
|
|
|
|
|
|
|
} |
465
|
|
|
|
|
|
|
] |
466
|
|
|
|
|
|
|
}, |
467
|
|
|
|
|
|
|
'transformImpliedDest' => { |
468
|
|
|
|
|
|
|
'.all' => [ |
469
|
|
|
|
|
|
|
{ |
470
|
|
|
|
|
|
|
'.ref' => 'jsonPointer' |
471
|
|
|
|
|
|
|
}, |
472
|
|
|
|
|
|
|
{ |
473
|
|
|
|
|
|
|
'.ref' => 'exprMapping' |
474
|
|
|
|
|
|
|
} |
475
|
|
|
|
|
|
|
] |
476
|
|
|
|
|
|
|
}, |
477
|
|
|
|
|
|
|
'transformMove' => { |
478
|
|
|
|
|
|
|
'.all' => [ |
479
|
|
|
|
|
|
|
{ |
480
|
|
|
|
|
|
|
'.ref' => 'jsonPointer' |
481
|
|
|
|
|
|
|
}, |
482
|
|
|
|
|
|
|
{ |
483
|
|
|
|
|
|
|
'-skip' => 1, |
484
|
|
|
|
|
|
|
'.ref' => 'opMoveFrom' |
485
|
|
|
|
|
|
|
}, |
486
|
|
|
|
|
|
|
{ |
487
|
|
|
|
|
|
|
'.ref' => 'jsonPointer' |
488
|
|
|
|
|
|
|
} |
489
|
|
|
|
|
|
|
] |
490
|
|
|
|
|
|
|
}, |
491
|
|
|
|
|
|
|
'transformation' => { |
492
|
|
|
|
|
|
|
'.all' => [ |
493
|
|
|
|
|
|
|
{ |
494
|
|
|
|
|
|
|
'-skip' => 1, |
495
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
496
|
|
|
|
|
|
|
}, |
497
|
|
|
|
|
|
|
{ |
498
|
|
|
|
|
|
|
'.any' => [ |
499
|
|
|
|
|
|
|
{ |
500
|
|
|
|
|
|
|
'.ref' => 'transformImpliedDest' |
501
|
|
|
|
|
|
|
}, |
502
|
|
|
|
|
|
|
{ |
503
|
|
|
|
|
|
|
'.ref' => 'transformCopy' |
504
|
|
|
|
|
|
|
}, |
505
|
|
|
|
|
|
|
{ |
506
|
|
|
|
|
|
|
'.ref' => 'transformMove' |
507
|
|
|
|
|
|
|
}, |
508
|
|
|
|
|
|
|
{ |
509
|
|
|
|
|
|
|
'-skip' => 1, |
510
|
|
|
|
|
|
|
'.ref' => 'ws2' |
511
|
|
|
|
|
|
|
} |
512
|
|
|
|
|
|
|
] |
513
|
|
|
|
|
|
|
}, |
514
|
|
|
|
|
|
|
{ |
515
|
|
|
|
|
|
|
'-skip' => 1, |
516
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/ |
517
|
|
|
|
|
|
|
} |
518
|
|
|
|
|
|
|
] |
519
|
|
|
|
|
|
|
}, |
520
|
|
|
|
|
|
|
'transforms' => { |
521
|
|
|
|
|
|
|
'+min' => 1, |
522
|
|
|
|
|
|
|
'-flat' => 1, |
523
|
|
|
|
|
|
|
'.ref' => 'transformation' |
524
|
|
|
|
|
|
|
}, |
525
|
|
|
|
|
|
|
'variableSystem' => { |
526
|
|
|
|
|
|
|
'.all' => [ |
527
|
|
|
|
|
|
|
{ |
528
|
|
|
|
|
|
|
'-skip' => 1, |
529
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\$/ |
530
|
|
|
|
|
|
|
}, |
531
|
|
|
|
|
|
|
{ |
532
|
|
|
|
|
|
|
'.rgx' => qr/\G([A-Z]*)/ |
533
|
|
|
|
|
|
|
} |
534
|
|
|
|
|
|
|
] |
535
|
|
|
|
|
|
|
}, |
536
|
|
|
|
|
|
|
'variableUser' => { |
537
|
|
|
|
|
|
|
'.all' => [ |
538
|
|
|
|
|
|
|
{ |
539
|
|
|
|
|
|
|
'-skip' => 1, |
540
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\$/ |
541
|
|
|
|
|
|
|
}, |
542
|
|
|
|
|
|
|
{ |
543
|
|
|
|
|
|
|
'.rgx' => qr/\G([a-z][a-zA-Z]*)/ |
544
|
|
|
|
|
|
|
} |
545
|
|
|
|
|
|
|
] |
546
|
|
|
|
|
|
|
}, |
547
|
|
|
|
|
|
|
'ws2' => { |
548
|
|
|
|
|
|
|
'.rgx' => qr/\G(?:\s|\x{FEFF}|[\ \t]*\-\-[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))+/ |
549
|
|
|
|
|
|
|
} |
550
|
|
|
|
|
|
|
} |
551
|
|
|
|
|
|
|
} |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
1; |