GraphQL/Language/Grammar.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 100% 24 / 24 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« GraphQL.pm ↑ Summary GraphQL/Plugin/Convert.pm »
1 package GraphQL::Language::Grammar;
2  
3 21 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 21 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 21 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 21 ▶use base 'Pegex::Grammar';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 21 ▶use constant file => './graphql.pgx';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 21 our $VERSION = '0.02';
10  
11 =head1 NAME
12  
13 GraphQL::Language::Grammar - GraphQL grammar
14  
15 =head1 SYNOPSIS
16  
17 use Pegex::Parser;
18 use GraphQL::Language::Grammar;
19 use Pegex::Tree::Wrap;
20 use Pegex::Input;
21  
22 my $parser = Pegex::Parser->new(
23 grammar => GraphQL::Language::Grammar->new,
24 receiver => Pegex::Tree::Wrap->new,
25 );
26 my $text = 'query q { foo(name: "hi") { id } }';
27 my $input = Pegex::Input->new(string => $text);
28 my $got = $parser->parse($input);
29  
30 =head1 DESCRIPTION
31  
32 This is a subclass of L<Pegex::Grammar>, with the GraphQL grammar.
33  
34 =head1 METHODS
35  
36 =head2 make_tree
37  
38 Override method from L<Pegex::Grammar>.
39  
40 =cut
41  
42 19 ▶sub make_tree { # Generated/Inlined by Pegex::Grammar (0.72)
Subroutine make_tree: called CC=1 SCAR=0.0
Pod documented
43 {
44 19 '+grammar' => 'graphql',
45 '+include' => 'pegex-atoms',
46 '+toprule' => 'graphql',
47 '+version' => '0.01',
48 'LSQUARE' => {
49 '.rgx' => qr/\G\[/
50 },
51 'RSQUARE' => {
52 '.rgx' => qr/\G\]/
53 },
54 '_' => {
55 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
56 },
57 'alias' => {
58 '.all' => [
59 {
60 '.ref' => 'name'
61 },
62 {
63 '-skip' => 1,
64 '.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))*/
65 }
66 ]
67 },
68 'argument' => {
69 '.all' => [
70 {
71 '.ref' => 'name'
72 },
73 {
74 '-skip' => 1,
75 '.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))*/
76 },
77 {
78 '.ref' => 'value'
79 }
80 ]
81 },
82 'arguments' => {
83 '.all' => [
84 {
85 '-skip' => 1,
86 '.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))*/
87 },
88 {
89 '+min' => 1,
90 '.ref' => 'argument'
91 },
92 {
93 '-skip' => 1,
94 '.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))*/
95 }
96 ]
97 },
98 'argumentsDefinition' => {
99 '.all' => [
100 {
101 '-skip' => 1,
102 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\(/
103 },
104 {
105 '+min' => 1,
106 '.ref' => 'inputValueDefinition'
107 },
108 {
109 '-skip' => 1,
110 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\)/
111 }
112 ]
113 },
114 'blockStringValue' => {
115 '.rgx' => qr/\G"""((?:(?:\\""")|[^\x00-\x1f"]|[\t\n\r]|(?:"(?!"")))*)"""/
116 },
117 'boolean' => {
118 '.rgx' => qr/\G(true|false)/
119 },
120 'defaultValue' => {
121 '.all' => [
122 {
123 '-skip' => 1,
124 '.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))*/
125 },
126 {
127 '.ref' => 'value_const'
128 }
129 ]
130 },
131 'definition' => {
132 '.any' => [
133 {
134 '.ref' => 'operationDefinition'
135 },
136 {
137 '.ref' => 'fragment'
138 },
139 {
140 '.ref' => 'typeSystemDefinition'
141 },
142 {
143 '-skip' => 1,
144 '.ref' => 'ws2'
145 }
146 ]
147 },
148 'description' => {
149 '.any' => [
150 {
151 '.all' => [
152 {
153 '-skip' => 1,
154 '.rgx' => qr/\G[\s\n]*/
155 },
156 {
157 '.ref' => 'string'
158 },
159 {
160 '-skip' => 1,
161 '.rgx' => qr/\G[\s\n]*/
162 }
163 ]
164 },
165 {
166 '-skip' => 1,
167 '.ref' => '_'
168 }
169 ]
170 },
171 'directive' => {
172 '.all' => [
173 {
174 '-skip' => 1,
175 '.rgx' => qr/\Gdirective(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\@(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
176 },
177 {
178 '.ref' => 'name'
179 },
180 {
181 '-skip' => 1,
182 '.ref' => '_'
183 },
184 {
185 '+max' => 1,
186 '.ref' => 'argumentsDefinition'
187 },
188 {
189 '-skip' => 1,
190 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*on(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
191 },
192 {
193 '.ref' => 'directiveLocations'
194 }
195 ]
196 },
197 'directiveLocations' => {
198 '.all' => [
199 {
200 '+max' => 1,
201 '-skip' => 1,
202 '.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))*/
203 },
204 {
205 '.all' => [
206 {
207 '.ref' => 'name'
208 },
209 {
210 '+min' => 0,
211 '-flat' => 1,
212 '.all' => [
213 {
214 '-skip' => 1,
215 '.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))*/
216 },
217 {
218 '.ref' => 'name'
219 }
220 ]
221 }
222 ]
223 }
224 ]
225 },
226 'directiveactual' => {
227 '.all' => [
228 {
229 '-skip' => 1,
230 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\@/
231 },
232 {
233 '.ref' => 'name'
234 },
235 {
236 '+max' => 1,
237 '.ref' => 'arguments'
238 }
239 ]
240 },
241 'directives' => {
242 '+min' => 1,
243 '.ref' => 'directiveactual'
244 },
245 'enumTypeDefinition' => {
246 '.all' => [
247 {
248 '-skip' => 1,
249 '.rgx' => qr/\Genum(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
250 },
251 {
252 '.ref' => 'name'
253 },
254 {
255 '-skip' => 1,
256 '.ref' => '_'
257 },
258 {
259 '+max' => 1,
260 '.ref' => 'directives'
261 },
262 {
263 '+max' => 1,
264 '.all' => [
265 {
266 '-skip' => 1,
267 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\{/
268 },
269 {
270 '+min' => 1,
271 '.ref' => 'enumValueDefinition'
272 },
273 {
274 '-skip' => 1,
275 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\}/
276 }
277 ]
278 }
279 ]
280 },
281 'enumValue' => {
282 '.any' => [
283 {
284 '.all' => [
285 {
286 '.rgx' => qr/\G(true|false|null)/
287 },
288 {
289 '.err' => 'Invalid enum value'
290 }
291 ]
292 },
293 {
294 '.ref' => 'name'
295 }
296 ]
297 },
298 'enumValueDefinition' => {
299 '.all' => [
300 {
301 '+max' => 1,
302 '.ref' => 'description'
303 },
304 {
305 '.ref' => 'enumValue'
306 },
307 {
308 '+max' => 1,
309 '.all' => [
310 {
311 '-skip' => 1,
312 '.ref' => '_'
313 },
314 {
315 '.ref' => 'directives'
316 }
317 ]
318 }
319 ]
320 },
321 'field' => {
322 '.all' => [
323 {
324 '+max' => 1,
325 '.ref' => 'alias'
326 },
327 {
328 '.ref' => 'name'
329 },
330 {
331 '-skip' => 1,
332 '.ref' => '_'
333 },
334 {
335 '+max' => 1,
336 '.ref' => 'arguments'
337 },
338 {
339 '-skip' => 1,
340 '.ref' => '_'
341 },
342 {
343 '+max' => 1,
344 '.ref' => 'directives'
345 },
346 {
347 '+max' => 1,
348 '.ref' => 'selectionSet'
349 }
350 ]
351 },
352 'fieldDefinition' => {
353 '.all' => [
354 {
355 '+max' => 1,
356 '.ref' => 'description'
357 },
358 {
359 '.ref' => 'name'
360 },
361 {
362 '-skip' => 1,
363 '.ref' => '_'
364 },
365 {
366 '+max' => 1,
367 '.ref' => 'argumentsDefinition'
368 },
369 {
370 '-skip' => 1,
371 '.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))*/
372 },
373 {
374 '.ref' => 'typedef'
375 },
376 {
377 '-skip' => 1,
378 '.ref' => '_'
379 },
380 {
381 '+max' => 1,
382 '.ref' => 'directives'
383 }
384 ]
385 },
386 'float' => {
387 '.rgx' => qr/\G(\-?(?:0|[1-9][0-9]*)(?:(?:\.[0-9]+)(?:[eE][\-\+]?[0-9]+)|(?:\.[0-9]+)|(?:[eE][\-\+]?[0-9]+)))/
388 },
389 'fragment' => {
390 '.all' => [
391 {
392 '-skip' => 1,
393 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*fragment(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
394 },
395 {
396 '.ref' => 'fragmentName'
397 },
398 {
399 '-skip' => 1,
400 '.ref' => '_'
401 },
402 {
403 '.any' => [
404 {
405 '.ref' => 'typeCondition'
406 },
407 {
408 '.err' => 'Expected "on"'
409 }
410 ]
411 },
412 {
413 '-skip' => 1,
414 '.ref' => '_'
415 },
416 {
417 '+max' => 1,
418 '.ref' => 'directives'
419 },
420 {
421 '.ref' => 'selectionSet'
422 }
423 ]
424 },
425 'fragmentName' => {
426 '.any' => [
427 {
428 '.all' => [
429 {
430 '.rgx' => qr/\Gon/
431 },
432 {
433 '.err' => 'Unexpected Name "on"'
434 }
435 ]
436 },
437 {
438 '.ref' => 'name'
439 }
440 ]
441 },
442 'fragment_spread' => {
443 '.all' => [
444 {
445 '-skip' => 1,
446 '.ref' => 'spread'
447 },
448 {
449 '.ref' => 'fragmentName'
450 },
451 {
452 '-skip' => 1,
453 '.ref' => '_'
454 },
455 {
456 '+max' => 1,
457 '.ref' => 'directives'
458 }
459 ]
460 },
461 'graphql' => {
462 '+min' => 1,
463 '.ref' => 'definition'
464 },
465 'implementsInterfaces' => {
466 '.all' => [
467 {
468 '-skip' => 1,
469 '.rgx' => qr/\Gimplements(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
470 },
471 {
472 '+max' => 1,
473 '-skip' => 1,
474 '.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))*/
475 },
476 {
477 '.all' => [
478 {
479 '.ref' => 'namedType'
480 },
481 {
482 '+min' => 0,
483 '-flat' => 1,
484 '.all' => [
485 {
486 '-skip' => 1,
487 '.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))*/
488 },
489 {
490 '.ref' => 'namedType'
491 }
492 ]
493 }
494 ]
495 }
496 ]
497 },
498 'inline_fragment' => {
499 '.all' => [
500 {
501 '-skip' => 1,
502 '.ref' => 'spread'
503 },
504 {
505 '+max' => 1,
506 '.ref' => 'typeCondition'
507 },
508 {
509 '-skip' => 1,
510 '.ref' => '_'
511 },
512 {
513 '+max' => 1,
514 '.ref' => 'directives'
515 },
516 {
517 '.ref' => 'selectionSet'
518 }
519 ]
520 },
521 'input' => {
522 '.all' => [
523 {
524 '-skip' => 1,
525 '.rgx' => qr/\Ginput(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
526 },
527 {
528 '.ref' => 'name'
529 },
530 {
531 '-skip' => 1,
532 '.ref' => '_'
533 },
534 {
535 '+max' => 1,
536 '.ref' => 'directives'
537 },
538 {
539 '+max' => 1,
540 '.all' => [
541 {
542 '-skip' => 1,
543 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\{/
544 },
545 {
546 '+min' => 1,
547 '.ref' => 'inputValueDefinition'
548 },
549 {
550 '-skip' => 1,
551 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\}/
552 }
553 ]
554 }
555 ]
556 },
557 'inputValueDefinition' => {
558 '.all' => [
559 {
560 '+max' => 1,
561 '.ref' => 'description'
562 },
563 {
564 '.ref' => 'name'
565 },
566 {
567 '-skip' => 1,
568 '.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))*/
569 },
570 {
571 '.ref' => 'typedef'
572 },
573 {
574 '-skip' => 1,
575 '.ref' => '_'
576 },
577 {
578 '+max' => 1,
579 '.ref' => 'defaultValue'
580 },
581 {
582 '-skip' => 1,
583 '.ref' => '_'
584 },
585 {
586 '+max' => 1,
587 '.ref' => 'directives'
588 },
589 {
590 '-skip' => 1,
591 '.ref' => '_'
592 }
593 ]
594 },
595 'int' => {
596 '.rgx' => qr/\G(\-?(?:0|[1-9][0-9]*))/
597 },
598 'interface' => {
599 '.all' => [
600 {
601 '-skip' => 1,
602 '.rgx' => qr/\Ginterface(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
603 },
604 {
605 '.ref' => 'name'
606 },
607 {
608 '-skip' => 1,
609 '.ref' => '_'
610 },
611 {
612 '+max' => 1,
613 '.ref' => 'directives'
614 },
615 {
616 '+max' => 1,
617 '.all' => [
618 {
619 '-skip' => 1,
620 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\{/
621 },
622 {
623 '+min' => 1,
624 '.ref' => 'fieldDefinition'
625 },
626 {
627 '-skip' => 1,
628 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\}/
629 }
630 ]
631 }
632 ]
633 },
634 'listType' => {
635 '.all' => [
636 {
637 '.ref' => 'LSQUARE'
638 },
639 {
640 '.ref' => 'typedef'
641 },
642 {
643 '.ref' => 'RSQUARE'
644 }
645 ]
646 },
647 'listValue' => {
648 '.all' => [
649 {
650 '-skip' => 1,
651 '.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))*/
652 },
653 {
654 '+min' => 0,
655 '.ref' => 'value'
656 },
657 {
658 '-skip' => 1,
659 '.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))*/
660 }
661 ]
662 },
663 'listValue_const' => {
664 '.all' => [
665 {
666 '-skip' => 1,
667 '.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))*/
668 },
669 {
670 '+min' => 0,
671 '.ref' => 'value_const'
672 },
673 {
674 '-skip' => 1,
675 '.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))*/
676 }
677 ]
678 },
679 'name' => {
680 '.rgx' => qr/\G([_a-zA-Z][0-9A-Za-z_]*)/
681 },
682 'namedType' => {
683 '.all' => [
684 {
685 '.ref' => 'name'
686 },
687 {
688 '-skip' => 1,
689 '.ref' => '_'
690 }
691 ]
692 },
693 'nonNullType' => {
694 '.any' => [
695 {
696 '.all' => [
697 {
698 '.ref' => 'namedType'
699 },
700 {
701 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*!/
702 }
703 ]
704 },
705 {
706 '.all' => [
707 {
708 '.ref' => 'listType'
709 },
710 {
711 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*!/
712 }
713 ]
714 }
715 ]
716 },
717 'null' => {
718 '.rgx' => qr/\G(null)/
719 },
720 'objectField' => {
721 '.all' => [
722 {
723 '.ref' => 'name'
724 },
725 {
726 '-skip' => 1,
727 '.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))*/
728 },
729 {
730 '.ref' => 'value'
731 },
732 {
733 '-skip' => 1,
734 '.ref' => '_'
735 }
736 ]
737 },
738 'objectField_const' => {
739 '.all' => [
740 {
741 '.ref' => 'name'
742 },
743 {
744 '-skip' => 1,
745 '.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))*/
746 },
747 {
748 '.ref' => 'value_const'
749 }
750 ]
751 },
752 'objectValue' => {
753 '.all' => [
754 {
755 '-skip' => 1,
756 '.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))*/
757 },
758 {
759 '.any' => [
760 {
761 '+min' => 1,
762 '.ref' => 'objectField'
763 },
764 {
765 '.err' => 'Expected name'
766 }
767 ]
768 },
769 {
770 '-skip' => 1,
771 '.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))*/
772 }
773 ]
774 },
775 'objectValue_const' => {
776 '.all' => [
777 {
778 '-skip' => 1,
779 '.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))*/
780 },
781 {
782 '.any' => [
783 {
784 '+min' => 1,
785 '.ref' => 'objectField_const'
786 },
787 {
788 '.err' => 'Expected name or constant'
789 }
790 ]
791 },
792 {
793 '-skip' => 1,
794 '.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))*/
795 }
796 ]
797 },
798 'operationDefinition' => {
799 '.any' => [
800 {
801 '.ref' => 'selectionSet'
802 },
803 {
804 '.all' => [
805 {
806 '.ref' => 'operationType'
807 },
808 {
809 '-skip' => 1,
810 '.ref' => '_'
811 },
812 {
813 '+max' => 1,
814 '.ref' => 'name'
815 },
816 {
817 '-skip' => 1,
818 '.ref' => '_'
819 },
820 {
821 '+max' => 1,
822 '.ref' => 'variableDefinitions'
823 },
824 {
825 '-skip' => 1,
826 '.ref' => '_'
827 },
828 {
829 '+max' => 1,
830 '.ref' => 'directives'
831 },
832 {
833 '.ref' => 'selectionSet'
834 }
835 ]
836 }
837 ]
838 },
839 'operationType' => {
840 '.rgx' => qr/\G(query|mutation|subscription)/
841 },
842 'operationTypeDefinition' => {
843 '.all' => [
844 {
845 '.ref' => 'operationType'
846 },
847 {
848 '-skip' => 1,
849 '.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))*/
850 },
851 {
852 '.ref' => 'namedType'
853 },
854 {
855 '-skip' => 1,
856 '.ref' => '_'
857 }
858 ]
859 },
860 'scalar' => {
861 '.all' => [
862 {
863 '-skip' => 1,
864 '.rgx' => qr/\Gscalar(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
865 },
866 {
867 '.ref' => 'name'
868 },
869 {
870 '-skip' => 1,
871 '.ref' => '_'
872 },
873 {
874 '+max' => 1,
875 '.ref' => 'directives'
876 }
877 ]
878 },
879 'schema' => {
880 '.all' => [
881 {
882 '-skip' => 1,
883 '.rgx' => qr/\Gschema(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
884 },
885 {
886 '+max' => 1,
887 '.ref' => 'directives'
888 },
889 {
890 '+max' => 1,
891 '.all' => [
892 {
893 '-skip' => 1,
894 '.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))*/
895 },
896 {
897 '+min' => 1,
898 '.ref' => 'operationTypeDefinition'
899 },
900 {
901 '-skip' => 1,
902 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\}/
903 }
904 ]
905 }
906 ]
907 },
908 'selection' => {
909 '.all' => [
910 {
911 '.any' => [
912 {
913 '.ref' => 'field'
914 },
915 {
916 '.ref' => 'inline_fragment'
917 },
918 {
919 '.ref' => 'fragment_spread'
920 }
921 ]
922 },
923 {
924 '-skip' => 1,
925 '.ref' => '_'
926 }
927 ]
928 },
929 'selectionSet' => {
930 '.all' => [
931 {
932 '-skip' => 1,
933 '.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))*/
934 },
935 {
936 '.any' => [
937 {
938 '+min' => 1,
939 '.ref' => 'selection'
940 },
941 {
942 '.err' => 'Expected name'
943 }
944 ]
945 },
946 {
947 '-skip' => 1,
948 '.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))*/
949 }
950 ]
951 },
952 'spread' => {
953 '.all' => [
954 {
955 '.rgx' => qr/\G\.{3}/
956 },
957 {
958 '-skip' => 1,
959 '.ref' => '_'
960 }
961 ]
962 },
963 'string' => {
964 '.any' => [
965 {
966 '.ref' => 'blockStringValue'
967 },
968 {
969 '.ref' => 'stringValue'
970 }
971 ]
972 },
973 'stringValue' => {
974 '.rgx' => qr/\G"((?:\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})|[^"\x00-\x1f\\])*)"/
975 },
976 'type' => {
977 '.all' => [
978 {
979 '-skip' => 1,
980 '.rgx' => qr/\Gtype(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
981 },
982 {
983 '.ref' => 'name'
984 },
985 {
986 '-skip' => 1,
987 '.ref' => '_'
988 },
989 {
990 '+max' => 1,
991 '.ref' => 'implementsInterfaces'
992 },
993 {
994 '-skip' => 1,
995 '.ref' => '_'
996 },
997 {
998 '+max' => 1,
999 '.ref' => 'directives'
1000 },
1001 {
1002 '+max' => 1,
1003 '.all' => [
1004 {
1005 '-skip' => 1,
1006 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\{/
1007 },
1008 {
1009 '+min' => 1,
1010 '.ref' => 'fieldDefinition'
1011 },
1012 {
1013 '-skip' => 1,
1014 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\}/
1015 }
1016 ]
1017 }
1018 ]
1019 },
1020 'typeCondition' => {
1021 '.all' => [
1022 {
1023 '-skip' => 1,
1024 '.rgx' => qr/\Gon(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
1025 },
1026 {
1027 '.ref' => 'namedType'
1028 }
1029 ]
1030 },
1031 'typeDefinition' => {
1032 '.any' => [
1033 {
1034 '.ref' => 'scalar'
1035 },
1036 {
1037 '.ref' => 'type'
1038 },
1039 {
1040 '.ref' => 'interface'
1041 },
1042 {
1043 '.ref' => 'union'
1044 },
1045 {
1046 '.ref' => 'enumTypeDefinition'
1047 },
1048 {
1049 '.ref' => 'input'
1050 }
1051 ]
1052 },
1053 'typeExtensionDefinition' => {
1054 '.all' => [
1055 {
1056 '-skip' => 1,
1057 '.rgx' => qr/\Gextend(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
1058 },
1059 {
1060 '.any' => [
1061 {
1062 '.ref' => 'schema'
1063 },
1064 {
1065 '.ref' => 'typeDefinition'
1066 }
1067 ]
1068 }
1069 ]
1070 },
1071 'typeSystemDefinition' => {
1072 '.all' => [
1073 {
1074 '+max' => 1,
1075 '.ref' => 'description'
1076 },
1077 {
1078 '.any' => [
1079 {
1080 '.ref' => 'schema'
1081 },
1082 {
1083 '.ref' => 'typeDefinition'
1084 },
1085 {
1086 '.ref' => 'typeExtensionDefinition'
1087 },
1088 {
1089 '.ref' => 'directive'
1090 }
1091 ]
1092 }
1093 ]
1094 },
1095 'typedef' => {
1096 '.any' => [
1097 {
1098 '.ref' => 'nonNullType'
1099 },
1100 {
1101 '.ref' => 'namedType'
1102 },
1103 {
1104 '.ref' => 'listType'
1105 }
1106 ]
1107 },
1108 'union' => {
1109 '.all' => [
1110 {
1111 '-skip' => 1,
1112 '.rgx' => qr/\Gunion(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*/
1113 },
1114 {
1115 '.ref' => 'name'
1116 },
1117 {
1118 '-skip' => 1,
1119 '.ref' => '_'
1120 },
1121 {
1122 '+max' => 1,
1123 '.ref' => 'directives'
1124 },
1125 {
1126 '+max' => 1,
1127 '.all' => [
1128 {
1129 '-skip' => 1,
1130 '.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))*/
1131 },
1132 {
1133 '.ref' => 'unionMembers'
1134 }
1135 ]
1136 }
1137 ]
1138 },
1139 'unionMembers' => {
1140 '.all' => [
1141 {
1142 '+max' => 1,
1143 '-skip' => 1,
1144 '.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))*/
1145 },
1146 {
1147 '.all' => [
1148 {
1149 '.ref' => 'namedType'
1150 },
1151 {
1152 '+min' => 0,
1153 '-flat' => 1,
1154 '.all' => [
1155 {
1156 '-skip' => 1,
1157 '.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))*/
1158 },
1159 {
1160 '.ref' => 'namedType'
1161 }
1162 ]
1163 }
1164 ]
1165 }
1166 ]
1167 },
1168 'value' => {
1169 '.all' => [
1170 {
1171 '.any' => [
1172 {
1173 '.ref' => 'variable'
1174 },
1175 {
1176 '.ref' => 'float'
1177 },
1178 {
1179 '.ref' => 'int'
1180 },
1181 {
1182 '.ref' => 'string'
1183 },
1184 {
1185 '.ref' => 'boolean'
1186 },
1187 {
1188 '.ref' => 'null'
1189 },
1190 {
1191 '.ref' => 'enumValue'
1192 },
1193 {
1194 '.ref' => 'listValue'
1195 },
1196 {
1197 '.ref' => 'objectValue'
1198 }
1199 ]
1200 },
1201 {
1202 '-skip' => 1,
1203 '.ref' => '_'
1204 }
1205 ]
1206 },
1207 'value_const' => {
1208 '.all' => [
1209 {
1210 '.any' => [
1211 {
1212 '.ref' => 'float'
1213 },
1214 {
1215 '.ref' => 'int'
1216 },
1217 {
1218 '.ref' => 'string'
1219 },
1220 {
1221 '.ref' => 'boolean'
1222 },
1223 {
1224 '.ref' => 'null'
1225 },
1226 {
1227 '.ref' => 'enumValue'
1228 },
1229 {
1230 '.ref' => 'listValue_const'
1231 },
1232 {
1233 '.ref' => 'objectValue_const'
1234 }
1235 ]
1236 },
1237 {
1238 '-skip' => 1,
1239 '.ref' => '_'
1240 }
1241 ]
1242 },
1243 'variable' => {
1244 '.all' => [
1245 {
1246 '-skip' => 1,
1247 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))*\$/
1248 },
1249 {
1250 '.ref' => 'name'
1251 }
1252 ]
1253 },
1254 'variableDefinition' => {
1255 '.all' => [
1256 {
1257 '.ref' => 'variable'
1258 },
1259 {
1260 '-skip' => 1,
1261 '.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))*/
1262 },
1263 {
1264 '.ref' => 'typedef'
1265 },
1266 {
1267 '+max' => 1,
1268 '.ref' => 'defaultValue'
1269 },
1270 {
1271 '-skip' => 1,
1272 '.ref' => '_'
1273 }
1274 ]
1275 },
1276 'variableDefinitions' => {
1277 '.all' => [
1278 {
1279 '-skip' => 1,
1280 '.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))*/
1281 },
1282 {
1283 '.any' => [
1284 {
1285 '+min' => 1,
1286 '.ref' => 'variableDefinition'
1287 },
1288 {
1289 '.err' => 'Expected $argument: Type'
1290 }
1291 ]
1292 },
1293 {
1294 '-skip' => 1,
1295 '.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))*/
1296 }
1297 ]
1298 },
1299 'ws2' => {
1300 '.rgx' => qr/\G(?:\s|\x{FEFF}|,|[\ \t]*\#[\ \t]*[^\r\n]*(?:\r?\n|\r!NL|\z))+/
1301 }
1302 }
1303 }
1304  
1305 21 1;
« GraphQL.pm ↑ Summary GraphQL/Plugin/Convert.pm »