Pegex/Pegex/Grammar.pm

filter: Statementstmt 90.0% 9 / 10 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 2 / 2 totaltotal 87.5% 14 / 16 CC 1 SCAR 2.2
CC
1
Cov
90%
text
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Pegex/Tree/Wrap.pm ↑ Summary Pegex/Grammar/Atoms.pm »
1 package Pegex::Pegex::Grammar;
2 17 ▶use Pegex::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 17 extends 'Pegex::Grammar';
4  
5 17 ▶use constant file => 'ext/pegex-pgx/pegex.pgx';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # sub make_tree {
8 # use Pegex::Bootstrap;
9 # use IO::All;
10 # my $grammar = io->file(file)->all;
11 # Pegex::Bootstrap->new->compile($grammar)->tree;
12 # }
13  
14 0 ▶sub text { # Generated/Inlined by Pegex::Grammar (0.72)
Subroutine text: not called CC=1 SCAR=6.9
Pod documented
15 0 <<'...';
16 # This is the Pegex grammar for Pegex grammars!
17  
18 %grammar pegex
19 %version 0.2.0
20 %include pegex-atoms
21  
22  
23 grammar:
24 meta-section
25 rule-section
26 ( doc-ending | ERROR-rule-definition )
27  
28 meta-section: ( meta-definition | + | ERROR-meta-definition )*
29  
30 rule-section: ( rule-definition | + )*
31  
32 meta-definition: / '%' meta-name BLANK+ meta-value /
33  
34 rule-definition: rule-start rule-group ending
35  
36 rule-start: / ( rule-name ) BLANK* ':' -/
37  
38 rule-group: any-group
39  
40 any-group: /- '|'? -/ all-group ( /- '|' -/ all-group )*
41  
42 all-group: rule-part (- rule-part)*
43  
44 rule-part: (rule-item)1-2 % /+ ( '%'{1,2} ) +/
45  
46 rule-item:
47 | bracketed-group
48 | whitespace-token
49 | rule-reference
50 | quoted-regex
51 | regular-expression
52 | error-message
53  
54 rule-reference:
55 /
56 ( rule-modifier? ) # [=!.-+]
57 (: # foo | <foo>
58 ( rule-name ) |
59 (: '<' ( rule-name ) '>' )
60 )
61 ( rule-quantifier? ) # [?*+] 2+ 2-3
62 (! BLANK* ':' ) # Avoid parsing 'foo:'
63 / # as a rule reference.
64  
65 quoted-regex:
66 / TICK ( [^ TICK ]* ) TICK /
67  
68 regular-expression:
69 /( group-modifier? )/
70 '/'
71 whitespace-start?
72 (
73 | whitespace-must
74 | whitespace-maybe
75 | quoted-regex
76 | regex-rule-reference
77 | +
78 | regex-raw
79 )*
80 '/'
81  
82 whitespace-start: / ([ PLUS DASH]) (! [ DASH TILDE ]) /
83  
84 whitespace-must: /+ (: PLUS | DASH DASH ) (= [ SPACE SLASH CR NL ]) /
85  
86 whitespace-maybe: /- DASH (= [ SPACE SLASH CR NL ]) /
87  
88 regex-rule-reference:
89 /
90 (:
91 + ( rule-name ) |
92 (: '<' ( rule-name ) '>' )
93 )
94 (! BLANK* ':' )
95 /
96  
97 regex-raw:
98 /
99 (
100 '(?'? '<' |
101 (?:[^ WS SLASH TICK LANGLE ])+
102 )
103 /
104  
105 bracketed-group:
106 / ( group-modifier? ) '(' -/
107 rule-group
108 /- ')' ( rule-quantifier? ) /
109  
110 whitespace-token:
111 / ( (: PLUS | DASH | DASH DASH | TILDE | TILDE TILDE ) ) (= + )/
112  
113 error-message:
114 / '`' ( [^ '`' DOS ]* ) '`' /
115  
116 rule-modifier: / [ BANG EQUAL PLUS DASH DOT ] /
117  
118 group-modifier: / [ DASH DOT ] /
119  
120 rule-quantifier:
121 / (:
122 [ STAR PLUS QMARK ] |
123 DIGIT+ (: DASH DIGIT+ | PLUS)?
124 ) /
125  
126 meta-name:
127 / ( 'grammar' | 'extends' | 'include' | 'version' ) /
128  
129 meta-value:
130 /
131 BLANK*
132 ( [^ SEMI BREAK ]*? )
133 BLANK*
134 ending
135 /
136  
137 rule_name: /
138 (:
139 ALPHA ALNUM* (:[ DASH UNDER ] ALNUM+)* |
140 DASH+ |
141 UNDER+
142 )
143 (= [^ WORD DASH ])
144 /
145  
146 ending: /
147 -
148 (:
149 BREAK - SEMI? - |
150 comment - SEMI? - |
151 SEMI - |
152 EOS
153 )
154 /
155  
156 ws: / (: WS | comment ) /
157  
158 comment: / '#' ANY* (: BREAK | EOS ) /
159  
160 ###
161 # Pegex common error recognition and reporting:
162 ###
163  
164 doc-ending: /- EOS /
165  
166 illegal-non-modifier-char: / [^
167 WORD LPAREN RPAREN LANGLE SLASH TILDE PIPE GRAVE WS
168 ] /
169  
170 illegal-non-quantifier-char: / [^
171 WORD LPAREN RPAREN LANGLE SLASH TILDE PIPE GRAVE WS
172 STAR PLUS QMARK BANG EQUAL PLUS DASH DOT COLON SEMI
173 ] /
174  
175 ERROR-meta-definition:
176 /(= PERCENT WORD+ )/
177 `Illegal meta rule`
178  
179 # Much of this is essentially a duplicate of the above rules, except with added
180 # error checking
181  
182 ERROR-rule-definition: ERROR-rule-start ERROR-rule-group ( ending | `Rule ending syntax error` )
183  
184 ERROR-rule-group: ERROR-any-group | ERROR-all-group
185  
186 ERROR-all-group: ERROR-rule-part+ % -
187  
188 ERROR-any-group: (ERROR-all-group)2+ % /- PIPE -/
189  
190 ERROR-rule-part: (ERROR-rule-item)1-2 % /+ ( PERCENT{1,2} ) +/
191  
192 ERROR-rule-start: / ( rule-name ) BLANK* COLON -/ | `Rule header syntax error`
193  
194 ERROR-rule-item:
195 rule-item |
196 ERROR-rule-reference |
197 ERROR-regular-expression |
198 ERROR-bracketed-group |
199 ERROR-error-message
200  
201 # Errors - rule-reference
202 ERROR-rule-reference:
203 /(= rule-modifier? LANGLE rule-name (! RANGLE ) )/
204 `Missing > in rule reference`
205 |
206 /(= rule-modifier? rule-name RANGLE )/
207 `Missing < in rule reference`
208 |
209 /(=
210 rule-modifier? (: rule-name | LANGLE rule-name RANGLE )
211 illegal-non-quantifier-char
212 )/
213 `Illegal character in rule quantifier`
214 |
215 /(= rule-modifier? rule-name DASH )/
216 `Unprotected rule name with numeric quantifier; please use <rule>#-# syntax!`
217 |
218 !rule-modifier
219 /(=
220 illegal-non-modifier-char
221 (: rule-name | LANGLE rule-name RANGLE )
222 rule-quantifier? # [?*+] 2+ 2-3
223 (! BLANK* COLON ) # Avoid parsing 'foo:'
224 )/ # as a rule reference.
225 `Illegal rule modifier (must be [=!.-+]?)`
226  
227 # Errors - regular-expression
228 ERROR-regular-expression:
229 /(= SLASH ( [^ SLASH ]* ) doc-ending )/
230 `Runaway regular expression; no ending slash at EOF`
231  
232 # Errors - bracketed-group
233 ERROR-bracketed-group:
234 /(! group-modifier) (= illegal-non-modifier-char LPAREN )/
235 `Illegal group rule modifier (can only use .)`
236 |
237 / ( group-modifier? ) LPAREN -/
238 rule-group
239 (
240 =doc-ending
241 `Runaway rule group; no ending parens at EOF`
242 |
243 / (= - RPAREN illegal-non-quantifier-char ) /
244 `Illegal character in group rule quantifier`
245 )
246  
247 # Errors - error-message
248 ERROR-error-message:
249 /(= GRAVE [^ GRAVE DOS ]* [ DOS ] [^ GRAVE ]* GRAVE )/
250 `Multi-line error messages not allowed!`
251 |
252 /(= GRAVE [^ GRAVE ]* doc-ending )/
253 `Runaway error message; no ending grave at EOF`
254  
255 # Errors - separation
256 ERROR-separation:
257 /(= - PERCENT{3} )/
258 `Leading separator form (BOK) no longer supported`
259 |
260 /(= - PERCENT{1,2} [^ WS ] )/
261 `Illegal characters in separator indicator`
262  
263 # vim: set lisp:
264 ...
265 }
266  
267 202 ▶sub make_tree { # Generated/Inlined by Pegex::Grammar (0.72)
Subroutine make_tree: called CC=1 SCAR=0.0
Pod documented
268 {
269 202 '+grammar' => 'pegex',
270 '+include' => 'pegex-atoms',
271 '+toprule' => 'grammar',
272 '+version' => '0.2.0',
273 'ERROR_all_group' => {
274 '.all' => [
275 {
276 '.ref' => 'ERROR_rule_part'
277 },
278 {
279 '+min' => 0,
280 '-flat' => 1,
281 '.all' => [
282 {
283 '.ref' => '_'
284 },
285 {
286 '.ref' => 'ERROR_rule_part'
287 }
288 ]
289 }
290 ]
291 },
292 'ERROR_any_group' => {
293 '.all' => [
294 {
295 '.ref' => 'ERROR_all_group'
296 },
297 {
298 '+min' => 1,
299 '-flat' => 1,
300 '.all' => [
301 {
302 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))*\|(?:\s|\#.*(?:\n|\z))*/
303 },
304 {
305 '.ref' => 'ERROR_all_group'
306 }
307 ]
308 }
309 ]
310 },
311 'ERROR_bracketed_group' => {
312 '.any' => [
313 {
314 '.all' => [
315 {
316 '.rgx' => qr/\G(?![\-\.])(?=[^\w\(\)<\/\~\|`\s]\()/
317 },
318 {
319 '.err' => 'Illegal group rule modifier (can only use .)'
320 }
321 ]
322 },
323 {
324 '.all' => [
325 {
326 '.rgx' => qr/\G([\-\.]?)\((?:\s|\#.*(?:\n|\z))*/
327 },
328 {
329 '.ref' => 'rule_group'
330 },
331 {
332 '.any' => [
333 {
334 '.all' => [
335 {
336 '+asr' => 1,
337 '.ref' => 'doc_ending'
338 },
339 {
340 '.err' => 'Runaway rule group; no ending parens at EOF'
341 }
342 ]
343 },
344 {
345 '.all' => [
346 {
347 '.rgx' => qr/\G(?=(?:\s|\#.*(?:\n|\z))*\)[^\w\(\)<\/\~\|`\s\*\+\?!=\+\-\.:;])/
348 },
349 {
350 '.err' => 'Illegal character in group rule quantifier'
351 }
352 ]
353 }
354 ]
355 }
356 ]
357 }
358 ]
359 },
360 'ERROR_error_message' => {
361 '.any' => [
362 {
363 '.all' => [
364 {
365 '.rgx' => qr/\G(?=`[^`\r\n]*[\r\n][^`]*`)/
366 },
367 {
368 '.err' => 'Multi-line error messages not allowed!'
369 }
370 ]
371 },
372 {
373 '.all' => [
374 {
375 '.rgx' => qr/\G(?=`[^`]*(?:\s|\#.*(?:\n|\z))*\z)/
376 },
377 {
378 '.err' => 'Runaway error message; no ending grave at EOF'
379 }
380 ]
381 }
382 ]
383 },
384 'ERROR_meta_definition' => {
385 '.all' => [
386 {
387 '.rgx' => qr/\G(?=%\w+)/
388 },
389 {
390 '.err' => 'Illegal meta rule'
391 }
392 ]
393 },
394 'ERROR_regular_expression' => {
395 '.all' => [
396 {
397 '.rgx' => qr/\G(?=\/([^\/]*)(?:\s|\#.*(?:\n|\z))*\z)/
398 },
399 {
400 '.err' => 'Runaway regular expression; no ending slash at EOF'
401 }
402 ]
403 },
404 'ERROR_rule_definition' => {
405 '.all' => [
406 {
407 '.ref' => 'ERROR_rule_start'
408 },
409 {
410 '.ref' => 'ERROR_rule_group'
411 },
412 {
413 '.any' => [
414 {
415 '.ref' => 'ending'
416 },
417 {
418 '.err' => 'Rule ending syntax error'
419 }
420 ]
421 }
422 ]
423 },
424 'ERROR_rule_group' => {
425 '.any' => [
426 {
427 '.ref' => 'ERROR_any_group'
428 },
429 {
430 '.ref' => 'ERROR_all_group'
431 }
432 ]
433 },
434 'ERROR_rule_item' => {
435 '.any' => [
436 {
437 '.ref' => 'rule_item'
438 },
439 {
440 '.ref' => 'ERROR_rule_reference'
441 },
442 {
443 '.ref' => 'ERROR_regular_expression'
444 },
445 {
446 '.ref' => 'ERROR_bracketed_group'
447 },
448 {
449 '.ref' => 'ERROR_error_message'
450 }
451 ]
452 },
453 'ERROR_rule_part' => {
454 '.all' => [
455 {
456 '.ref' => 'ERROR_rule_item'
457 },
458 {
459 '+max' => 1,
460 '+min' => 0,
461 '-flat' => 1,
462 '.all' => [
463 {
464 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))+(%{1,2})(?:\s|\#.*(?:\n|\z))+/
465 },
466 {
467 '.ref' => 'ERROR_rule_item'
468 }
469 ]
470 }
471 ]
472 },
473 'ERROR_rule_reference' => {
474 '.any' => [
475 {
476 '.all' => [
477 {
478 '.rgx' => qr/\G(?=[!=\+\-\.]?<(?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-])(?!\>))/
479 },
480 {
481 '.err' => 'Missing > in rule reference'
482 }
483 ]
484 },
485 {
486 '.all' => [
487 {
488 '.rgx' => qr/\G(?=[!=\+\-\.]?(?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-])\>)/
489 },
490 {
491 '.err' => 'Missing < in rule reference'
492 }
493 ]
494 },
495 {
496 '.all' => [
497 {
498 '.rgx' => qr/\G(?=[!=\+\-\.]?(?:(?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-])|<(?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-])\>)[^\w\(\)<\/\~\|`\s\*\+\?!=\+\-\.:;])/
499 },
500 {
501 '.err' => 'Illegal character in rule quantifier'
502 }
503 ]
504 },
505 {
506 '.all' => [
507 {
508 '.rgx' => qr/\G(?=[!=\+\-\.]?(?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-])\-)/
509 },
510 {
511 '.err' => 'Unprotected rule name with numeric quantifier; please use <rule>#-# syntax!'
512 }
513 ]
514 },
515 {
516 '.all' => [
517 {
518 '+asr' => -1,
519 '.ref' => 'rule_modifier'
520 },
521 {
522 '.rgx' => qr/\G(?=[^\w\(\)<\/\~\|`\s](?:(?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-])|<(?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-])\>)(?:[\*\+\?]|[0-9]+(?:\-[0-9]+|\+)?)?(?![\ \t]*:))/
523 },
524 {
525 '.err' => 'Illegal rule modifier (must be [=!.-+]?)'
526 }
527 ]
528 }
529 ]
530 },
531 'ERROR_rule_start' => {
532 '.any' => [
533 {
534 '.rgx' => qr/\G((?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-]))[\ \t]*:(?:\s|\#.*(?:\n|\z))*/
535 },
536 {
537 '.err' => 'Rule header syntax error'
538 }
539 ]
540 },
541 '_' => {
542 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))*/
543 },
544 '__' => {
545 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))+/
546 },
547 'all_group' => {
548 '.all' => [
549 {
550 '.ref' => 'rule_part'
551 },
552 {
553 '+min' => 0,
554 '.all' => [
555 {
556 '.ref' => '_'
557 },
558 {
559 '.ref' => 'rule_part'
560 }
561 ]
562 }
563 ]
564 },
565 'any_group' => {
566 '.all' => [
567 {
568 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))*\|?(?:\s|\#.*(?:\n|\z))*/
569 },
570 {
571 '.ref' => 'all_group'
572 },
573 {
574 '+min' => 0,
575 '.all' => [
576 {
577 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))*\|(?:\s|\#.*(?:\n|\z))*/
578 },
579 {
580 '.ref' => 'all_group'
581 }
582 ]
583 }
584 ]
585 },
586 'bracketed_group' => {
587 '.all' => [
588 {
589 '.rgx' => qr/\G([\-\.]?)\((?:\s|\#.*(?:\n|\z))*/
590 },
591 {
592 '.ref' => 'rule_group'
593 },
594 {
595 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))*\)((?:[\*\+\?]|[0-9]+(?:\-[0-9]+|\+)?)?)/
596 }
597 ]
598 },
599 'doc_ending' => {
600 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))*\z/
601 },
602 'ending' => {
603 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))*(?:\n(?:\s|\#.*(?:\n|\z))*;?(?:\s|\#.*(?:\n|\z))*|\#.*(?:\n|\z)(?:\s|\#.*(?:\n|\z))*;?(?:\s|\#.*(?:\n|\z))*|;(?:\s|\#.*(?:\n|\z))*|\z)/
604 },
605 'error_message' => {
606 '.rgx' => qr/\G`([^`\r\n]*)`/
607 },
608 'grammar' => {
609 '.all' => [
610 {
611 '.ref' => 'meta_section'
612 },
613 {
614 '.ref' => 'rule_section'
615 },
616 {
617 '.any' => [
618 {
619 '.ref' => 'doc_ending'
620 },
621 {
622 '.ref' => 'ERROR_rule_definition'
623 }
624 ]
625 }
626 ]
627 },
628 'meta_definition' => {
629 '.rgx' => qr/\G%(grammar|extends|include|version)[\ \t]+[\ \t]*([^;\n]*?)[\ \t]*(?:\s|\#.*(?:\n|\z))*(?:\n(?:\s|\#.*(?:\n|\z))*;?(?:\s|\#.*(?:\n|\z))*|\#.*(?:\n|\z)(?:\s|\#.*(?:\n|\z))*;?(?:\s|\#.*(?:\n|\z))*|;(?:\s|\#.*(?:\n|\z))*|\z)/
630 },
631 'meta_section' => {
632 '+min' => 0,
633 '.any' => [
634 {
635 '.ref' => 'meta_definition'
636 },
637 {
638 '.ref' => '__'
639 },
640 {
641 '.ref' => 'ERROR_meta_definition'
642 }
643 ]
644 },
645 'quoted_regex' => {
646 '.rgx' => qr/\G'([^']*)'/
647 },
648 'regex_raw' => {
649 '.rgx' => qr/\G(\(\??<|(?:[^\s\/'<])+)/
650 },
651 'regex_rule_reference' => {
652 '.rgx' => qr/\G(?:(?:\s|\#.*(?:\n|\z))+((?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-]))|(?:<((?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-]))\>))(?![\ \t]*:)/
653 },
654 'regular_expression' => {
655 '.all' => [
656 {
657 '.rgx' => qr/\G([\-\.]?)/
658 },
659 {
660 '.rgx' => qr/\G\//
661 },
662 {
663 '+max' => 1,
664 '.ref' => 'whitespace_start'
665 },
666 {
667 '+min' => 0,
668 '.any' => [
669 {
670 '.ref' => 'whitespace_must'
671 },
672 {
673 '.ref' => 'whitespace_maybe'
674 },
675 {
676 '.ref' => 'quoted_regex'
677 },
678 {
679 '.ref' => 'regex_rule_reference'
680 },
681 {
682 '.ref' => '__'
683 },
684 {
685 '.ref' => 'regex_raw'
686 }
687 ]
688 },
689 {
690 '.rgx' => qr/\G\//
691 }
692 ]
693 },
694 'rule_definition' => {
695 '.all' => [
696 {
697 '.ref' => 'rule_start'
698 },
699 {
700 '.ref' => 'rule_group'
701 },
702 {
703 '.ref' => 'ending'
704 }
705 ]
706 },
707 'rule_group' => {
708 '.ref' => 'any_group'
709 },
710 'rule_item' => {
711 '.any' => [
712 {
713 '.ref' => 'bracketed_group'
714 },
715 {
716 '.ref' => 'whitespace_token'
717 },
718 {
719 '.ref' => 'rule_reference'
720 },
721 {
722 '.ref' => 'quoted_regex'
723 },
724 {
725 '.ref' => 'regular_expression'
726 },
727 {
728 '.ref' => 'error_message'
729 }
730 ]
731 },
732 'rule_modifier' => {
733 '.rgx' => qr/\G[!=\+\-\.]/
734 },
735 'rule_part' => {
736 '.all' => [
737 {
738 '.ref' => 'rule_item'
739 },
740 {
741 '+max' => 1,
742 '+min' => 0,
743 '-flat' => 1,
744 '.all' => [
745 {
746 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))+(%{1,2})(?:\s|\#.*(?:\n|\z))+/
747 },
748 {
749 '.ref' => 'rule_item'
750 }
751 ]
752 }
753 ]
754 },
755 'rule_reference' => {
756 '.rgx' => qr/\G([!=\+\-\.]?)(?:((?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-]))|(?:<((?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-]))\>))((?:[\*\+\?]|[0-9]+(?:\-[0-9]+|\+)?)?)(?![\ \t]*:)/
757 },
758 'rule_section' => {
759 '+min' => 0,
760 '.any' => [
761 {
762 '.ref' => 'rule_definition'
763 },
764 {
765 '.ref' => '__'
766 }
767 ]
768 },
769 'rule_start' => {
770 '.rgx' => qr/\G((?:[a-zA-Z][a-zA-Z0-9]*(?:[\-_][a-zA-Z0-9]+)*|\-+|_+)(?=[^\w\-]))[\ \t]*:(?:\s|\#.*(?:\n|\z))*/
771 },
772 'whitespace_maybe' => {
773 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))*\-(?=[\ \/\r\n])/
774 },
775 'whitespace_must' => {
776 '.rgx' => qr/\G(?:\s|\#.*(?:\n|\z))+(?:\+|\-\-)(?=[\ \/\r\n])/
777 },
778 'whitespace_start' => {
779 '.rgx' => qr/\G([\+\-])(?![\-\~])/
780 },
781 'whitespace_token' => {
782 '.rgx' => qr/\G((?:\+|\-|\-\-|\~|\~\~))(?=(?:\s|\#.*(?:\n|\z))+)/
783 }
784 }
785 }
786  
787 17 1;
« Pegex/Tree/Wrap.pm ↑ Summary Pegex/Grammar/Atoms.pm »