PPR/X.pm

filter: Statementstmt 35.0% 28 / 80 Branchbran 7.1% 1 / 14 Conditioncond 5.8% 1 / 17 MC/DCmcdc 0.0% 0 / 9 Subroutinesub 52.6% 10 / 19 Podpod 100% 1 / 1 totaltotal 29.2% 41 / 140 CC 17 SCAR 24.1
CC
17
Cov
27%
decomment
30.0
diagnostic
20.0
_report
13.6
CRAP 11.1
↑ Summary PPR.pm »
1 package PPR::X;
2  
3 7 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use if $] < 5.018004, re => 'eval';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 7 ▶BEGIN {
Subroutine BEGIN: called CC=3 SCAR=17.3
7 7 ▶ if ($] >= 5.020 && $] <= 5.021) {
Branch: 1 branch
BranchTrueFalseTotal
if ($] >= "5.02" and $] <= "5.021") 0 7 7
Condition33%1/3
$] >= "5.02" and $] <= "5.021"
!ll&&!rl&&r
070
MC/DC0%0/2
$] >= "5.02" and $] <= "5.021"
$] >= "5.02" $] <= "5.021"
Truth table33%1/3
A and B
A= $] >= "5.02"B= $] <= "5.021"
ABresult
0X0
100
111
8 0 say {STDERR} <<" END_WARNING"
9 Warning: This program is running under Perl $^V and uses the PPR::X module.
10 Due to an unresolved issue with compilation of large regexes
11 in this version of Perl, your code is likely to compile
12 extremely slowly (i.e. it may take more than a minute).
13 0 PPR::X is being loaded at ${\join ' line ', (caller(2))[1,2]}.
14 END_WARNING
15 }
16 }
17 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 7 our $VERSION = '0.001009';
19 7 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 7 ▶use List::Util qw<min max>;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 # Class for $PPR::X::ERROR objects...
23 { package PPR::X::ERROR;
24  
25 7 ▶ use overload q{""} => 'source', q{0+} => 'line', fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 1 ▶ sub new {
Subroutine new: called CC=1 SCAR=0.0
28 1 my ($class, %obj) = @_;
29 1 return bless \%obj, $class;
30 }
31  
32 0 ▶ sub prefix { return shift->{prefix} }
Subroutine prefix: not called CC=1 SCAR=6.9
33  
34 0 ▶ sub source { return shift->{source} }
Subroutine source: not called CC=1 SCAR=6.9
35  
36 0 ▶ sub line { my $self = shift;
Subroutine line: not called CC=3 SCAR=24.8
37 0 ▶ my $offset = $self->{line} // shift // 1;
Condition0%0/5
($self->{"line"} // shift()) // 1
l!l
00
$self->{"line"} // shift()
l!l&&r!l&&!r
000
MC/DC0%0/2
($self->{"line"} // shift()) // 1
$self->{"line"} shift()
Truth table0%0/3
A // B
A= $self->{"line"}B= shift()
ABresult
1X1
011
000
38 0 return $offset + $self->{prefix} =~ tr/\n//;
39 }
40  
41 0 ▶ sub origin { my $self = shift;
Subroutine origin: not called CC=3 SCAR=24.8
42 0 ▶ my $line = shift // 0;
Condition0%0/2
shift() // 0
l!l
00
MC/DC0%0/1
shift() // 0
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
43 0 ▶ my $file = shift // "";
Condition0%0/2
shift() // ""
l!l
00
MC/DC0%0/1
shift() // ""
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
44 0 return bless { %{$self}, line => $line, file => $file }, ref($self);
45 }
46  
47 0 ▶ sub diagnostic { my $self = shift;
Subroutine diagnostic: not called CC=4 SCAR=30.0
48 my $line = defined $self->{line}
49 0 ▶ ? $self->{line} + $self->{prefix} =~ tr/\n//
Branch: 1 branch
BranchTrueFalseTotal
defined $self->{'line'} ? : 0 0 0
50 : 0;
51 0 ▶ my $file = $self->{file} // q{};
Condition0%0/2
$self->{"file"} // ""
l!l
00
MC/DC0%0/1
$self->{"file"} // ""
$self->{"file"}
Truth table0%0/2
A
A= $self->{"file"}
Aresult
11
00
52 0 ▶ return q{} if eval "no strict;\n"
Branch: 1 branch
BranchTrueFalseTotal
if eval "no strict;\n" . "#line $line $file\n" . qq[sub{ $self->{"source"} }] 0 0 0
53 . "#line $line $file\n"
54 . "sub{ $self->{source} }";
55 0 my $diagnostic = $@;
56 0 $diagnostic =~ s{ \s*+ \bat \s++ \( eval \s++ \d++ \) \s++ line \s++ 0,
57 | \s*+ \( eval \s++ \d++ \)
58 | \s++ \Z
59 | \s++ \bExecution \s++ of \s++ .*? \s++ aborted
60 \s++ due \s++ to \s++ compilation \s++ errors\.
61 }{}gx;
62 0 return $diagnostic;
63 }
64 }
65  
66 # Define the grammar...
67 7 our $GRAMMAR = qr{
68 (?(DEFINE)
69  
70 (?<PerlEntireDocument> (?<PerlStdEntireDocument>
71 \A
72 (?&PerlDocument)
73 (?:
74 \Z
75 |
76 (?(?{ !defined $PPR::X::ERROR })
77 (?>(?&PerlOWSOrEND)) (?{pos()}) ([^\n]++)
78 (?{ $PPR::X::ERROR = PPR::X::ERROR->new(source => "$^N", prefix => substr($_, 0, $^R) ) })
79 (?!)
80 )
81 )
82 )) # End of rule
83  
84 (?<PerlDocument> (?<PerlStdDocument>
85 \x{FEFF}?+ # Optional BOM marker
86 (?&PerlStatementSequence)
87 (?&PerlOWSOrEND)
88 )) # End of rule
89  
90 (?<PerlStatementSequence> (?<PerlStdStatementSequence>
91 (?>(?&PerlPodSequence))
92 (?:
93 (?&PerlStatement)
94 (?&PerlPodSequence)
95 )*+
96 )) # End of rule
97  
98 (?<PerlStatement> (?<PerlStdStatement>
99 (?>
100 (?>(?&PerlPodSequence))
101 (?: (?>(?&PerlLabel)) (?&PerlOWSOrEND) )?+
102 (?>(?&PerlPodSequence))
103 (?>
104 (?&PerlKeyword)
105 |
106 (?&PerlSubroutineDeclaration)
107 |
108 (?&PerlMethodDeclaration)
109 |
110 (?&PerlUseStatement)
111 |
112 (?&PerlPackageDeclaration)
113 |
114 (?&PerlClassDeclaration)
115 |
116 (?&PerlFieldDeclaration)
117 |
118 (?&PerlControlBlock)
119 |
120 (?&PerlFormat)
121 |
122 (?>(?&PerlExpression)) (?>(?&PerlOWS))
123 (?&PerlStatementModifier)?+ (?>(?&PerlOWSOrEND))
124 (?> ; | (?= \} | \z ))
125 |
126 (?&PerlBlock)
127 |
128 ;
129 )
130  
131 | # A yada-yada...
132 \.\.\. (?>(?&PerlOWSOrEND))
133 (?> ; | (?= \} | \z ))
134  
135 | # Just a label...
136 (?>(?&PerlLabel)) (?>(?&PerlOWSOrEND))
137 (?> ; | (?= \} | \z ))
138  
139 | # Just an empty statement...
140 (?>(?&PerlOWS)) ;
141  
142 | # An error (report it, if it's the first)...
143 (?(?{ !defined $PPR::X::ERROR })
144 (?> (?&PerlOWS) )
145 (?! (?: \} | \z ) )
146 (?{ pos() })
147 ( (?&PerlExpression) (?&PerlOWS) [^\n]++ | [^;\}]++ )
148 (?{ $PPR::X::ERROR //= PPR::X::ERROR->new(source => $^N, prefix => substr($_, 0, $^R) ) })
149 (?!)
150 )
151 )
152 )) # End of rule
153  
154 (?<PerlSubroutineDeclaration> (?<PerlStdSubroutineDeclaration>
155 (?>
156 (?: (?> my | our | state ) \b (?>(?&PerlOWS)) )?+
157 sub \b (?>(?&PerlOWS))
158 (?>(?&PerlOldQualifiedIdentifier)) (?&PerlOWS)
159 |
160 AUTOLOAD (?&PerlOWS)
161 |
162 DESTROY (?&PerlOWS)
163 )
164 (?:
165 # Perl pre 5.028
166 (?:
167 (?>
168 (?&PerlSignature) # Parameter list
169 |
170 \( [^)]*+ \) # Prototype (
171 )
172 (?&PerlOWS)
173 )?+
174 (?: (?>(?&PerlAttributes)) (?&PerlOWS) )?+
175 |
176 # Perl post 5.028
177 (?: (?>(?&PerlAttributes)) (?&PerlOWS) )?+
178 (?: (?>(?&PerlSignature)) (?&PerlOWS) )?+ # Parameter list
179 )
180 (?> ; | (?&PerlBlock) )
181 )) # End of rule
182  
183 (?<PerlMethodDeclaration> (?<PerlStdMethodDeclaration>
184 method \b (?>(?&PerlOWS))
185 (?>(?&PerlQualifiedIdentifier)) (?&PerlOWS)
186 (?: (?>(?&PerlAttributes)) (?&PerlOWS) )?+
187 (?: (?>(?&PerlSignature)) (?&PerlOWS) )?+ # Parameter list
188 (?> ; | (?&PerlBlock) )
189 )) # End of rule
190  
191 (?<PerlSignature> (?<PerlStdSignature>
192 \(
193 (?>(?&PerlOWS))
194 (?&PerlParameterDeclaration)*+
195 \)
196 )) # End of rule
197  
198 (?<PerlParameterDeclaration> (?<PerlStdParameterDeclaration>
199 (?:
200 \$ (?>(?&PerlOWS))
201 (?:
202 (?: = | //= | \|\|= ) (?>(?&PerlOWS))
203 (?&PerlConditionalExpression)?+ (?>(?&PerlOWS))
204 )?+
205 |
206 (?&PerlVariableScalar) (?>(?&PerlOWS))
207 (?:
208 (?: = | //= | \|\|= ) (?>(?&PerlOWS))
209 (?&PerlConditionalExpression) (?>(?&PerlOWS))
210 )?+
211 |
212 (?&PerlVariableArray) (?>(?&PerlOWS))
213 |
214 (?&PerlVariableHash) (?>(?&PerlOWS))
215 )
216 (?: , (?>(?&PerlOWS)) | (?= \) ) ) # (
217 )) # End of rule
218  
219  
220 (?<PerlUseStatement> (?<PerlStdUseStatement>
221 (?: use | no ) (?>(?&PerlNWS))
222 (?>
223 (?&PerlVersionNumber)
224 |
225 (?>(?&PerlQualifiedIdentifier))
226 (?: (?>(?&PerlNWS)) (?&PerlVersionNumber)
227 (?! (?>(?&PerlOWS)) (?> (?&PerlInfixBinaryOperator) | (?&PerlComma) | \? ) )
228 )?+
229 (?: (?>(?&PerlNWS)) (?&PerlPodSequence) )?+
230 (?: (?>(?&PerlOWS)) (?&PerlExpression) )?+
231 )
232 (?>(?&PerlOWSOrEND)) (?> ; | (?= \} | \z ))
233 )) # End of rule
234  
235 (?<PerlReturnExpression> (?<PerlStdReturnExpression>
236 return \b (?: (?>(?&PerlOWS)) (?&PerlExpression) )?+
237 )) # End of rule
238  
239 (?<PerlReturnStatement> (?<PerlStdReturnStatement>
240 return \b (?: (?>(?&PerlOWS)) (?&PerlExpression) )?+
241 (?>(?&PerlOWSOrEND)) (?> ; | (?= \} | \z ))
242 )) # End of rule
243  
244 (?<PerlPackageDeclaration> (?<PerlStdPackageDeclaration>
245 package
246 (?>(?&PerlNWS)) (?>(?&PerlQualifiedIdentifier))
247 (?: (?>(?&PerlNWS)) (?&PerlVersionNumber) )?+
248 (?>(?&PerlOWSOrEND)) (?> ; | (?&PerlBlock) | (?= \} | \z ))
249 )) # End of rule
250  
251 (?<PerlClassDeclaration> (?<PerlStdClassDeclaration>
252 class
253 (?>(?&PerlNWS)) (?>(?&PerlQualifiedIdentifier))
254 (?: (?>(?&PerlNWS)) (?&PerlVersionNumber)
255 | (?>(?&PerlOWS)) : (?>(?&PerlOWS)) isa (?= \( ) (?&PPR_X_quotelike_body)
256 )?+
257 (?>(?&PerlOWSOrEND)) (?> ; | (?&PerlBlock) | (?= \} | \z ))
258 )) # End of rule
259  
260 (?<PerlExpression> (?<PerlStdExpression>
261 (?>(?&PerlLowPrecedenceNotExpression))
262 (?: (?>(?&PerlOWS)) (?>(?&PerlLowPrecedenceInfixOperator))
263 (?>(?&PerlOWS)) (?&PerlLowPrecedenceNotExpression) )*+
264 )) # End of rule
265  
266 (?<PerlLowPrecedenceNotExpression> (?<PerlStdLowPrecedenceNotExpression>
267 (?: not \b (?&PerlOWS) )*+ (?&PerlCommaList)
268 )) # End of rule
269  
270 (?<PerlCommaList> (?<PerlStdCommaList>
271 (?>(?&PerlAssignment)) (?>(?&PerlOWS))
272 (?:
273 (?: (?>(?&PerlComma)) (?&PerlOWS) )++
274 (?>(?&PerlAssignment)) (?>(?&PerlOWS))
275 )*+
276 (?: (?>(?&PerlComma)) (?&PerlOWSOrEND) )*+
277 )) # End of rule
278  
279 (?<PerlAssignment> (?<PerlStdAssignment>
280 (?>(?&PerlConditionalExpression))
281 (?:
282 (?>(?&PerlOWS)) (?>(?&PerlAssignmentOperator))
283 (?>(?&PerlOWS)) (?&PerlConditionalExpression)
284 )*+
285 )) # End of rule
286  
287 (?<PerlScalarExpression> (?<PerlStdScalarExpression>
288 (?<PerlConditionalExpression> (?<PerlStdConditionalExpression>
289 (?>(?&PerlBinaryExpression))
290 (?:
291 (?>(?&PerlOWS)) \? (?>(?&PerlOWS)) (?>(?&PerlAssignment))
292 (?>(?&PerlOWS)) : (?>(?&PerlOWS)) (?&PerlConditionalExpression)
293 )?+
294 )) # End of rule
295 )) # End of rule
296  
297 (?<PerlBinaryExpression> (?<PerlStdBinaryExpression>
298 (?>(?&PerlPrefixPostfixTerm))
299 (?: (?>(?&PerlOWS)) (?>(?&PerlInfixBinaryOperator))
300 (?>(?&PerlOWS)) (?&PerlPrefixPostfixTerm) )*+
301 )) # End of rule
302  
303 (?<PerlPrefixPostfixTerm> (?<PerlStdPrefixPostfixTerm>
304 (?: (?>(?&PerlPrefixUnaryOperator)) (?&PerlOWS) )*+
305 (?>(?&PerlTerm))
306 (?: (?>(?&PerlOWS)) (?&PerlPostfixUnaryOperator) )?+
307 )) # End of rule
308  
309 (?<PerlLvalue> (?<PerlStdLvalue>
310 (?>
311 \\?+ [\$\@%] (?>(?&PerlOWS)) (?&PerlIdentifier)
312 |
313 \( (?>(?&PerlOWS))
314 (?> \\?+ [\$\@%] (?>(?&PerlOWS)) (?&PerlIdentifier) | undef ) (?>(?&PerlOWS))
315 (?:
316 (?>(?&PerlComma)) (?>(?&PerlOWS))
317 (?> \\?+ [\$\@%] (?>(?&PerlOWS)) (?&PerlIdentifier) | undef ) (?>(?&PerlOWS))
318 )*+
319 (?: (?>(?&PerlComma)) (?&PerlOWS) )?+
320 \)
321 )
322 )) # End of rule
323  
324 (?<PerlTerm> (?<PerlStdTerm>
325 (?>
326 (?&PerlReturnExpression)
327  
328 # The remaining alternatives can all take postfix dereferencers...
329 | (?:
330 (?= \$ ) (?&PerlScalarAccess)
331 |
332 (?= \@ ) (?&PerlArrayAccess)
333 |
334 (?= % ) (?&PerlHashAccess)
335 |
336 (?&PerlAnonymousSubroutine)
337 |
338 (?&PerlAnonymousMethod)
339 |
340 (?>(?&PerlNullaryBuiltinFunction)) (?! (?>(?&PerlOWS)) \( )
341 |
342 (?&PerlDoBlock) | (?&PerlEvalBlock)
343 |
344 (?&PerlCall)
345 |
346 (?&PerlVariableDeclaration)
347 |
348 (?&PerlTypeglob)
349 |
350 (?>(?&PerlParenthesesList))
351  
352 # Can optionally do a [...] lookup straight after the parens,
353 # followed by any number of other look-ups
354 (?:
355 (?>(?&PerlOWS)) (?&PerlArrayIndexer)
356 (?:
357 (?>(?&PerlOWS))
358 (?>
359 (?&PerlArrayIndexer)
360 | (?&PerlHashIndexer)
361 | (?&PerlParenthesesList)
362 )
363 )*+
364 )?+
365 |
366 (?&PerlAnonymousArray)
367 |
368 (?&PerlAnonymousHash)
369 |
370 (?&PerlDiamondOperator)
371 |
372 (?&PerlContextualMatch)
373 |
374 (?&PerlQuotelikeS)
375 |
376 (?&PerlQuotelikeTR)
377 |
378 (?&PerlQuotelikeQX)
379 |
380 (?&PerlLiteral)
381 )
382  
383 (?: (?&PerlTermPostfixDereference) )?+
384 )
385 )) # End of rule
386  
387 (?<PerlTermPostfixDereference> (?<PerlStdTermPostfixDereference>
388 # Must have at least one arrowed dereference...
389 (?:
390 (?>(?&PerlOWS)) -> (?>(?&PerlOWS))
391 (?>
392 # A series of simple brackets can omit interstitial arrows...
393 (?> (?&PerlParenthesesList) | (?&PerlArrayIndexer) | (?&PerlHashIndexer) )
394 (?:
395 (?>(?&PerlOWS))
396 (?> (?&PerlParenthesesList) | (?&PerlArrayIndexer) | (?&PerlHashIndexer) )
397 )*+
398  
399 | # A method call...
400 (?> (?&PerlQualifiedIdentifier) | (?! \$\#\* ) (?&PerlVariableScalar) )
401 (?: (?>(?&PerlOWS)) (?&PerlParenthesesList) )?+
402  
403 | # An array or hash slice or k/v slice
404 # (provided it's not subsequently dereferenced)
405 [\@%] (?> (?>(?&PerlArrayIndexer)) | (?>(?&PerlHashIndexer)) )
406 (?! (?>(?&PerlOWS)) -> (?>(?&PerlOWS)) [\@%]?+ [\[\{] )
407  
408 | # An array max-index lookup...
409 \$\#\*
410  
411 | # A scalar-, glob-, or subroutine dereference...
412 [\$*&] \*
413  
414 | # An array dereference (provided it's not subsequently dereferenced)...
415 \@\*
416 (?! (?>(?&PerlOWS)) -> (?>(?&PerlOWS)) [\[\@] )
417  
418 | # A hash dereference (provided it's not subsequently dereferenced)...
419 \%\*
420 (?! (?>(?&PerlOWS)) -> (?>(?&PerlOWS)) [\{%] )
421  
422 | # A glob lookup...
423 \* (?&PerlHashIndexer)
424 )
425 )++
426 )) # End of rule
427  
428 (?<PerlControlBlock> (?<PerlStdControlBlock>
429 (?> # Conditionals...
430 (?> if | unless ) \b (?>(?&PerlOWS))
431 (?>(?&PerlParenthesesList)) (?>(?&PerlOWS))
432 (?>(?&PerlBlock))
433  
434 (?:
435 (?>(?&PerlOWS))
436 (?>(?&PerlPodSequence))
437 elsif \b (?>(?&PerlOWS))
438 (?>(?&PerlParenthesesList)) (?>(?&PerlOWS))
439 (?&PerlBlock)
440 )*+
441  
442 (?:
443 (?>(?&PerlOWS))
444 (?>(?&PerlPodSequence))
445 else \b (?>(?&PerlOWS))
446 (?&PerlBlock)
447 )?+
448  
449 | # Loops...
450 (?>
451 for(?:each)?+ \b
452 (?>(?&PerlOWS))
453 (?:
454 (?> # Explicitly aliased iterator variable...
455 (?> \\ (?>(?&PerlOWS)) (?> my | our | state )
456 | (?> my | our | state ) (?>(?&PerlOWS)) \\
457 )
458 (?>(?&PerlOWS))
459 (?> (?&PerlVariableScalar)
460 | (?&PerlVariableArray)
461 | (?&PerlVariableHash)
462 )
463 |
464 # List of scalar iterator variables...
465 my (?>(?&PerlOWS))
466 \( (?>(?&PerlOWS))
467 (?>(?&PerlVariableScalar)) (?>(?&PerlOWS))
468 (?: , (?>(?&PerlOWS))
469 (?>(?&PerlVariableScalar)) (?>(?&PerlOWS))
470 )*+
471 (?: , (?>(?&PerlOWS)) )?+
472 \)
473  
474 |
475 # Implicitly aliased iterator variable...
476 (?> (?: my | our | state ) (?>(?&PerlOWS)) )?+
477 (?&PerlVariableScalar)
478 )?+
479 (?>(?&PerlOWS))
480 (?> (?&PerlParenthesesList) | (?&PerlQuotelikeQW) )
481 |
482 (?&PPR_X_three_part_list)
483 )
484 |
485 (?> while | until) \b (?>(?&PerlOWS))
486 (?&PerlParenthesesList)
487 )
488  
489 (?>(?&PerlOWS))
490 (?>(?&PerlBlock))
491  
492 (?:
493 (?>(?&PerlOWS)) continue
494 (?>(?&PerlOWS)) (?&PerlBlock)
495 )?+
496  
497 | # Phasers...
498 (?> BEGIN | END | CHECK | INIT | UNITCHECK | ADJUST ) \b (?>(?&PerlOWS))
499 (?&PerlBlock)
500  
501 | # Try/catch/finallys...
502 (?>(?&PerlTryCatchFinallyBlock))
503  
504 | # Defers...
505 defer (?>(?&PerlOWS))
506 (?&PerlBlock)
507  
508 | # Switches...
509 (?> given | when ) \b (?>(?&PerlOWS))
510 (?>(?&PerlParenthesesList)) (?>(?&PerlOWS))
511 (?&PerlBlock)
512 |
513 default (?>(?&PerlOWS))
514 (?&PerlBlock)
515 )
516 )) # End of rule
517  
518 (?<PerlFormat> (?<PerlStdFormat>
519 format
520 (?: (?>(?&PerlNWS)) (?&PerlQualifiedIdentifier) )?+
521 (?>(?&PerlOWS)) = [^\n]*+
522 (?&PPR_X_newline_and_heredoc)
523 (?:
524 (?! \. \n )
525 [^\n\$\@]*+
526 (?:
527 (?>
528 (?= \$ (?! \s ) ) (?&PerlScalarAccessNoSpace)
529 |
530 (?= \@ (?! \s ) ) (?&PerlArrayAccessNoSpace)
531 )
532 [^\n\$\@]*+
533 )*+
534 (?&PPR_X_newline_and_heredoc)
535 )*+
536 \. (?&PerlEndOfLine)
537 )) # End of rule
538  
539 (?<PerlStatementModifier> (?<PerlStdStatementModifier>
540 (?> if | for(?:each)?+ | while | unless | until | when )
541 \b
542 (?>(?&PerlOWS))
543 (?&PerlExpression)
544 )) # End of rule
545  
546 (?<PerlBlock> (?<PerlStdBlock>
547 \{ (?>(?&PerlStatementSequence)) \}
548 )) # End of rule
549  
550 (?<PerlCall> (?<PerlStdCall>
551 (?>
552 [&] (?>(?&PerlOWS))
553 (?> (?&PerlBlock)
554 | (?&PerlVariableScalar)
555 | (?&PerlQualifiedIdentifier)
556 ) (?>(?&PerlOWS))
557 (?:
558 \( (?>(?&PerlOWS))
559 (?: (?>(?&PerlExpression)) (?&PerlOWS) )?+
560 \)
561 )?+
562 |
563 - (?>(?&PPR_X_filetest_name)) (?>(?&PerlOWS))
564 (?&PerlPrefixPostfixTerm)?+
565 |
566 (?>(?&PerlBuiltinFunction)) (?>(?&PerlOWS))
567 (?>
568 \( (?>(?&PerlOWS))
569 (?>
570 (?= (?>(?&PPR_X_non_reserved_identifier))
571 (?>(?&PerlOWS))
572 (?! \( | (?&PerlComma) )
573 )
574 (?&PerlCall)
575 |
576 (?>(?&PerlBlock)) (?>(?&PerlOWS))
577 (?&PerlExpression)?+
578 |
579 (?>(?&PPR_X_indirect_obj)) (?>(?&PerlNWS))
580 (?&PerlExpression)
581 |
582 (?&PerlExpression)?+
583 ) (?>(?&PerlOWS))
584 \)
585 |
586 (?>
587 (?=
588 (?>(?&PPR_X_non_reserved_identifier))
589 (?>(?&PerlOWS))
590 (?! \( | (?&PerlComma) )
591 )
592 (?&PerlCall)
593 |
594 (?>(?&PerlBlock)) (?>(?&PerlOWS))
595 (?&PerlCommaList)?+
596 |
597 (?>(?&PPR_X_indirect_obj)) (?>(?&PerlNWS))
598 (?&PerlCommaList)
599 |
600 (?&PerlCommaList)?+
601 )
602 )
603 |
604 (?>(?&PPR_X_non_reserved_identifier)) (?>(?&PerlOWS))
605 (?>
606 \( (?>(?&PerlOWS))
607 (?: (?>(?&PerlExpression)) (?&PerlOWS) )?+
608 \)
609 |
610 (?>
611 (?=
612 (?>(?&PPR_X_non_reserved_identifier))
613 (?>(?&PerlOWS))
614 (?! \( | (?&PerlComma) )
615 )
616 (?&PerlCall)
617 |
618 (?>(?&PerlBlock)) (?>(?&PerlOWS))
619 (?&PerlCommaList)?+
620 |
621 (?>(?&PPR_X_indirect_obj)) (?&PerlNWS)
622 (?&PerlCommaList)
623 |
624 (?&PerlCommaList)?+
625 )
626 )
627 )
628 )) # End of rule
629  
630 (?<PerlVariableDeclaration> (?<PerlStdVariableDeclaration>
631 (?> my | our | state ) \b (?>(?&PerlOWS))
632 (?: (?&PerlQualifiedIdentifier) (?&PerlOWS) )?+
633 (?>(?&PerlLvalue)) (?>(?&PerlOWS))
634 (?&PerlAttributes)?+
635 )) # End of rule
636  
637 (?<PerlFieldDeclaration> (?<PerlStdFieldDeclaration>
638 field \b
639 (?>(?&PerlOWS)) [\$\@%]
640 (?>(?&PerlOWS)) (?&PerlIdentifier)
641 (?:
642 (?>(?&PerlOWS)) :
643 (?>(?&PerlOWS)) param
644 (?:
645 (?= \( ) (?&PPR_X_quotelike_body) # )
646 )?+
647 )?+
648 (?:
649 (?>(?&PerlOWS)) (?: //= | \|\|= | = )
650 (?>(?&PerlOWS)) (?&PerlConditionalExpression)
651 )?+
652 (?>(?&PerlOWSOrEND)) (?> ; | (?= \} | \z ))
653 )) # End of rule
654  
655 (?<PerlDoBlock> (?<PerlStdDoBlock>
656 do (?>(?&PerlOWS)) (?&PerlBlock)
657 )) # End of rule
658  
659 (?<PerlEvalBlock> (?<PerlStdEvalBlock>
660 eval (?>(?&PerlOWS)) (?&PerlBlock)
661 )) # End of rule
662  
663 (?<PerlTryCatchFinallyBlock> (?<PerlStdTryCatchFinallyBlock>
664  
665 try \b (?>(?&PerlOWS))
666 (?>(?&PerlBlock))
667 (?>(?&PerlOWS))
668 catch \b (?>(?&PerlOWS))
669 \( (?>(?&PerlVariableScalar)) \) (?>(?&PerlOWS))
670 (?>(?&PerlBlock))
671  
672 (?:
673 (?>(?&PerlOWS))
674 finally \b (?>(?&PerlOWS))
675 (?>(?&PerlBlock))
676 )?+
677 )) # End of rule
678  
679 (?<PerlAttributes> (?<PerlStdAttributes>
680 :
681 (?>(?&PerlOWS))
682 (?>(?&PerlIdentifier))
683 (?:
684 (?= \( ) (?&PPR_X_quotelike_body)
685 )?+
686  
687 (?:
688 (?> (?>(?&PerlOWS)) : (?&PerlOWS) | (?&PerlNWS) )
689 (?>(?&PerlIdentifier))
690 (?:
691 (?= \( ) (?&PPR_X_quotelike_body)
692 )?+
693 )*+
694 )) # End of rule
695  
696 (?<PerlList> (?<PerlStdList>
697 (?> (?&PerlParenthesesList) | (?&PerlCommaList) )
698 )) # End of rule
699  
700 (?<PerlParenthesesList> (?<PerlStdParenthesesList>
701 \( (?>(?&PerlOWS)) (?: (?>(?&PerlExpression)) (?&PerlOWS) )?+ \)
702 )) # End of rule
703  
704 (?<PerlAnonymousArray> (?<PerlStdAnonymousArray>
705 \[ (?>(?&PerlOWS)) (?: (?>(?&PerlExpression)) (?&PerlOWS) )?+ \]
706 )) # End of rule
707  
708 (?<PerlAnonymousHash> (?<PerlStdAnonymousHash>
709 \{ (?>(?&PerlOWS)) (?: (?>(?&PerlExpression)) (?&PerlOWS) )?+ \}
710 )) # End of rule
711  
712 (?<PerlArrayIndexer> (?<PerlStdArrayIndexer>
713 \[ (?>(?&PerlOWS))
714 (?>(?&PerlExpression)) (?>(?&PerlOWS))
715 \]
716 )) # End of rule
717  
718 (?<PerlHashIndexer> (?<PerlStdHashIndexer>
719 \{ (?>(?&PerlOWS))
720 (?: -?+ (?&PerlIdentifier) | (?&PerlExpression) ) # (Note: MUST allow backtracking here)
721 (?>(?&PerlOWS))
722 \}
723 )) # End of rule
724  
725 (?<PerlDiamondOperator> (?<PerlStdDiamondOperator>
726 <<>> # Perl 5.22 "double diamond"
727 |
728 < (?! < )
729 (?>(?&PPR_X_balanced_angles))
730 >
731 (?=
732 (?>(?&PerlOWSOrEND))
733 (?> \z | [,;\}\])?] | => | : (?! :) # (
734 | (?&PerlInfixBinaryOperator) | (?&PerlLowPrecedenceInfixOperator)
735 | (?= \w) (?> for(?:each)?+ | while | if | unless | until | when )
736 )
737 )
738 )) # End of rule
739  
740 (?<PerlComma> (?<PerlStdComma>
741 (?> , | => )
742 )) # End of rule
743  
744 (?<PerlPrefixUnaryOperator> (?<PerlStdPrefixUnaryOperator>
745 (?> \+\+ | -- | [!\\+~] | - (?! (?&PPR_X_filetest_name) \b ) )
746 )) # End of rule
747  
748 (?<PerlPostfixUnaryOperator> (?<PerlStdPostfixUnaryOperator>
749 (?> \+\+ | -- )
750 )) # End of rule
751  
752 (?<PerlInfixBinaryOperator> (?<PerlStdInfixBinaryOperator>
753 (?> [=!][~=]
754 | cmp
755 | <= >?+
756 | >=
757 | [lg][te]
758 | eq
759 | ne
760 | [+] (?! [+=] )
761 | - (?! [-=] )
762 | [.]{2,3}+
763 | [.%x] (?! [=] )
764 | [&|^][.] (?! [=] )
765 | [<>*&|/]{1,2}+ (?! [=] )
766 | \^ (?! [=] )
767 | ~~
768 | isa
769 )
770 )) # End of rule
771  
772 (?<PerlAssignmentOperator> (?<PerlStdAssignmentOperator>
773 (?: [<>*&|/]{2}
774 | [-+.*/%x]
775 | [&|^][.]?+
776 )?+
777 =
778 (?! > )
779 )) # End of rule
780  
781 (?<PerlLowPrecedenceInfixOperator> (?<PerlStdLowPrecedenceInfixOperator>
782 (?> or | and | xor )
783 )) # End of rule
784  
785 (?<PerlAnonymousSubroutine> (?<PerlStdAnonymousSubroutine>
786 sub \b
787 (?>(?&PerlOWS))
788 (?:
789 # Perl pre 5.028
790 (?:
791 (?>
792 (?&PerlSignature) # Parameter list
793 |
794 \( [^)]*+ \) # Prototype (
795 )
796 (?&PerlOWS)
797 )?+
798 (?: (?>(?&PerlAttributes)) (?&PerlOWS) )?+
799 |
800 # Perl post 5.028
801 (?: (?>(?&PerlAttributes)) (?&PerlOWS) )?+
802 (?: (?>(?&PerlSignature)) (?&PerlOWS) )?+ # Parameter list
803 )
804 (?&PerlBlock)
805 )) # End of rule
806  
807 (?<PerlAnonymousMethod> (?<PerlStdAnonymousMethod>
808 method \b
809 (?>(?&PerlOWS))
810 (?: (?>(?&PerlAttributes)) (?&PerlOWS) )?+
811 (?: (?>(?&PerlSignature)) (?&PerlOWS) )?+ # Parameter list
812 (?&PerlBlock)
813 )) # End of rule
814  
815 (?<PerlVariable> (?<PerlStdVariable>
816 (?= [\$\@%] )
817 (?>
818 (?&PerlScalarAccess)
819 | (?&PerlHashAccess)
820 | (?&PerlArrayAccess)
821 )
822 (?> (?&PerlTermPostfixDereference) )?+
823 )) # End of rule
824  
825 (?<PerlTypeglob> (?<PerlStdTypeglob>
826 \*
827 (?>
828 \d++
829 |
830 \^ [][A-Z^_?\\]
831 |
832 \{ \^ [A-Z_] \w*+ \}
833 |
834 (?>(?&PerlOldQualifiedIdentifier)) (?: :: )?+
835 |
836 (?&PerlVariableScalar)
837 |
838 [][!"#\$%&'()*+,./:;<=>?\@\^`|~-]
839 |
840 (?&PerlBlock)
841 )
842  
843 # Optional arrowless access(es) to begin (but can't start with a parens)...
844 (?:
845 (?! (?>(?&PerlOWS)) \( )
846 (?:
847 (?>(?&PerlOWS))
848 (?: (?&PerlArrayIndexer) | (?&PerlHashIndexer) | (?&PerlParenthesesList) )
849 )++
850 )?+
851  
852 # Note: subsequent arrowed postdereferences that would follow here
853 # are handled at the <PerlTerm> level
854  
855 )) # End of rule
856  
857 (?<PerlArrayAccess> (?<PerlStdArrayAccess>
858 (?>(?&PerlVariableArray))
859  
860 # Optional arrowless access(es) to begin (but can't start with a parens)...
861 (?:
862 (?! (?>(?&PerlOWS)) \( )
863 (?:
864 (?>(?&PerlOWS))
865 (?: (?&PerlArrayIndexer) | (?&PerlHashIndexer) | (?&PerlParenthesesList) )
866 )++
867 )?+
868  
869 # Note: subsequent arrowed postdereferences that would follow here
870 # are handled at the <PerlTerm> level
871  
872 )) # End of rule
873  
874 (?<PerlArrayAccessNoSpace> (?<PerlStdArrayAccessNoSpace>
875 (?>(?&PerlVariableArrayNoSpace))
876  
877 # Optional arrowless access(es) to begin
878 (?: (?&PerlArrayIndexer) | (?&PerlHashIndexer) )*+
879  
880 # Then any number of optional arrowed accesses
881 # (this is an inlined subset of (?&PerlTermPostfixDereference))...
882 (?:
883 ->
884 (?>
885 # A series of simple brackets can omit interstitial arrows...
886 (?: (?&PerlArrayIndexer)
887 | (?&PerlHashIndexer)
888 )++
889  
890 | # An array or hash slice...
891 \@ (?> (?>(?&PerlArrayIndexer)) | (?>(?&PerlHashIndexer)) )
892 )
893 )*+
894  
895 # Followed by at most one of these terminal arrowed dereferences...
896 (?:
897 ->
898 (?>
899 # An array or scalar deref...
900 [\@\$] \*
901  
902 | # An array count deref...
903 \$ \# \*
904 )
905 )?+
906 )) # End of rule
907  
908 (?<PerlArrayAccessNoSpaceNoArrow> (?<PerlStdArrayAccessNoSpaceNoArrow>
909 (?>(?&PerlVariableArray))
910 (?:
911 (?: (?&PerlArrayIndexer) | (?&PerlHashIndexer) )
912 )*+
913 )) # End of rule
914  
915 (?<PerlHashAccess> (?<PerlStdHashAccess>
916 (?>(?&PerlVariableHash))
917  
918 # Optional arrowless access(es) to begin (but can't start with a parens)...
919 (?:
920 (?! (?>(?&PerlOWS)) \( )
921 (?:
922 (?>(?&PerlOWS))
923 (?: (?&PerlArrayIndexer) | (?&PerlHashIndexer) | (?&PerlParenthesesList) )
924 )++
925 )?+
926 )) # End of rule
927  
928 (?<PerlScalarAccess> (?<PerlStdScalarAccess>
929 (?>(?&PerlVariableScalar))
930  
931 # Optional arrowless access(es) to begin (but can't start with a parens)...
932 (?:
933 (?! (?>(?&PerlOWS)) \( )
934 (?:
935 (?>(?&PerlOWS))
936 (?: (?&PerlArrayIndexer) | (?&PerlHashIndexer) | (?&PerlParenthesesList) )
937 )++
938 )?+
939  
940 # Note: subsequent arrowed postdereferences that would follow here
941 # are handled at the <PerlTerm> level
942  
943 )) # End of rule
944  
945 (?<PerlScalarAccessNoSpace> (?<PerlStdScalarAccessNoSpace>
946 (?>(?&PerlVariableScalarNoSpace))
947  
948 # Optional arrowless access(es) to begin...
949 (?: (?&PerlArrayIndexer) | (?&PerlHashIndexer) )*+
950  
951 # Then any nuber of arrowed accesses
952 # (this is an inlined subset of (?&PerlTermPostfixDereference))...
953 (?:
954 ->
955 (?>
956 # A series of simple brackets can omit interstitial arrows...
957 (?: (?&PerlArrayIndexer)
958 | (?&PerlHashIndexer)
959 )++
960  
961 | # An array or hash slice...
962 \@ (?> (?>(?&PerlArrayIndexer)) | (?>(?&PerlHashIndexer)) )
963 )
964 )*+
965  
966 # Followed by at most one of these terminal arrowed dereferences...
967 (?:
968 ->
969 (?>
970 # An array or scalar deref...
971 [\@\$] \*
972  
973 | # An array count deref...
974 \$ \# \*
975 )
976 )?+
977 )) # End of rule
978  
979 (?<PerlScalarAccessNoSpaceNoArrow> (?<PerlStdScalarAccessNoSpaceNoArrow>
980 (?>(?&PerlVariableScalarNoSpace))
981  
982 # Optional arrowless access(es) (but parens can't be first)...
983 (?:
984 (?! \( )
985 (?:
986 (?> (?&PerlArrayIndexer) | (?&PerlHashIndexer) | (?&PerlParenthesesList) )
987 )++
988 )?+
989 )) # End of rule
990  
991 (?<PerlVariableScalar> (?<PerlStdVariableScalar>
992 \$\$
993 (?! [\$\{\w] )
994 |
995 (?:
996 \$
997 (?:
998 [#]
999 (?= (?> [\$^\w\{:+] | - (?! > ) ) )
1000 )?+
1001 (?&PerlOWS)
1002 )++
1003 (?>
1004 \d++
1005 |
1006 \^ [][A-Z^_?\\]
1007 |
1008 \{ \^ [A-Z_] \w*+ \}
1009 |
1010 (?>(?&PerlOldQualifiedIdentifier)) (?: :: )?+
1011 |
1012 :: (?&PerlBlock)
1013 |
1014 [][!"#\$%&'()*+,.\\/:;<=>?\@\^`|~-]
1015 |
1016 \{ [!"#\$%&'()*+,.\\/:;<=>?\@\^`|~-] \}
1017 |
1018 \{ \w++ \}
1019 |
1020 (?&PerlBlock)
1021 )
1022 |
1023 \$\#
1024 )) # End of rule
1025  
1026 (?<PerlVariableScalarNoSpace> (?<PerlStdVariableScalarNoSpace>
1027 \$\$
1028 (?! [\$\{\w] )
1029 |
1030 (?:
1031 \$
1032 (?:
1033 [#]
1034 (?= (?> [\$^\w\{:+] | - (?! > ) ) )
1035 )?+
1036 )++
1037 (?>
1038 \d++
1039 |
1040 \^ [][A-Z^_?\\]
1041 |
1042 \{ \^ [A-Z_] \w*+ \}
1043 |
1044 (?>(?&PerlOldQualifiedIdentifier)) (?: :: )?+
1045 |
1046 :: (?&PerlBlock)
1047 |
1048 [][!"#\$%&'()*+,.\\/:;<=>?\@\^`|~-]
1049 |
1050 \{ \w++ \}
1051 |
1052 (?&PerlBlock)
1053 )
1054 |
1055 \$\#
1056 )) # End of rule
1057  
1058 (?<PerlVariableArray> (?<PerlStdVariableArray>
1059 \@ (?>(?&PerlOWS))
1060 (?: \$ (?&PerlOWS) )*+
1061 (?>
1062 \d++
1063 |
1064 \^ [][A-Z^_?\\]
1065 |
1066 \{ \^ [A-Z_] \w*+ \}
1067 |
1068 (?>(?&PerlOldQualifiedIdentifier)) (?: :: )?+
1069 |
1070 :: (?&PerlBlock)
1071 |
1072 [][!"#\$%&'()*+,.\\/:;<=>?\@\^`|~-]
1073 |
1074 (?&PerlBlock)
1075 )
1076 )) # End of rule
1077  
1078 (?<PerlVariableArrayNoSpace> (?<PerlStdVariableArrayNoSpace>
1079 \@
1080 (?: \$ )*+
1081 (?>
1082 \d++
1083 |
1084 \^ [][A-Z^_?\\]
1085 |
1086 \{ \^ [A-Z_] \w*+ \}
1087 |
1088 (?>(?&PerlOldQualifiedIdentifier)) (?: :: )?+
1089 |
1090 :: (?&PerlBlock)
1091 |
1092 [][!"#\$%&'()*+,.\\/:;<=>?\@\^`|~-]
1093 |
1094 (?&PerlBlock)
1095 )
1096 )) # End of rule
1097  
1098 (?<PerlVariableHash> (?<PerlStdVariableHash>
1099 % (?>(?&PerlOWS))
1100 (?: \$ (?&PerlOWS) )*+
1101 (?>
1102 \d++
1103 |
1104 \^ [][A-Z^_?\\]
1105 |
1106 \{ \^ [A-Z_] \w*+ \}
1107 |
1108 (?>(?&PerlOldQualifiedIdentifier)) (?: :: )?+
1109 |
1110 :: (?&PerlBlock)?+
1111 |
1112 [][!"#\$%&'()*+,.\\/:;<=>?\@\^`|~-]
1113 |
1114 (?&PerlBlock)
1115 )
1116 )) # End of rule
1117  
1118 (?<PerlLabel> (?<PerlStdLabel>
1119 (?! (?> [msy] | q[wrxq]?+ | tr ) \b )
1120 (?>(?&PerlIdentifier))
1121 : (?! : )
1122 )) # End of rule
1123  
1124 (?<PerlLiteral> (?<PerlStdLiteral>
1125 (?> (?&PerlString)
1126 | (?&PerlQuotelikeQR)
1127 | (?&PerlQuotelikeQW)
1128 | (?&PerlNumber)
1129 | (?&PerlBareword)
1130 )
1131 )) # End of rule
1132  
1133 (?<PerlString> (?<PerlStdString>
1134 (?>
1135 (?&PerlQuotelikeQ)
1136 |
1137 (?&PerlQuotelikeQQ)
1138 |
1139 (?&PerlHeredoc)
1140 |
1141 (?&PerlVString)
1142 )
1143 )) # End of rule
1144  
1145 (?<PerlQuotelike> (?<PerlStdQuotelike>
1146 (?> (?&PerlString)
1147 | (?&PerlQuotelikeQR)
1148 | (?&PerlQuotelikeQW)
1149 | (?&PerlQuotelikeQX)
1150 | (?&PerlContextualMatch)
1151 | (?&PerlQuotelikeS)
1152 | (?&PerlQuotelikeTR)
1153 )
1154 )) # End of rule
1155  
1156 (?<PerlHeredoc> (?<PerlStdHeredoc>
1157 # Match the introducer...
1158 <<
1159 (?<_heredoc_indented> [~]?+ )
1160  
1161 # Match the terminator specification...
1162 (?>
1163 \\?+ (?<_heredoc_terminator> (?&PerlIdentifier) )
1164 |
1165 (?>(?&PerlOWS))
1166 (?>
1167 " (?<_heredoc_terminator> [^"\\]*+ (?: \\. [^"\\]*+ )*+ ) " #"
1168 |
1169 (?<PPR_X_HD_nointerp> ' )
1170 (?<_heredoc_terminator> [^'\\]*+ (?: \\. [^'\\]*+ )*+ ) ' #'
1171 |
1172 ` (?<_heredoc_terminator> [^`\\]*+ (?: \\. [^`\\]*+ )*+ ) ` #`
1173 )
1174 |
1175 (?<_heredoc_terminator> )
1176 )
1177  
1178 # Do we need to reset the heredoc cache???
1179 (?{
1180 if ( ($PPR::X::_heredoc_origin // q{}) ne $_ ) {
1181 %PPR::X::_heredoc_skip = ();
1182 %PPR::X::_heredoc_parsed_to = ();
1183 $PPR::X::_heredoc_origin = $_;
1184 }
1185 })
1186  
1187 # Do we need to cache content lookahead for this heredoc???
1188 (?(?{ my $need_to_lookahead = !$PPR::X::_heredoc_parsed_to{+pos()};
1189 $PPR::X::_heredoc_parsed_to{+pos()} = 1;
1190 $need_to_lookahead;
1191 })
1192  
1193 # Lookahead to detect and remember trailing contents of heredoc
1194 (?=
1195 [^\n]*+ \n # Go to the end of the current line
1196 (?{ +pos() }) # Remember the start of the contents
1197 (??{ $PPR::X::_heredoc_skip{+pos()} // q{} }) # Skip earlier heredoc contents
1198 (?> # The heredoc contents consist of...
1199 (?:
1200 (?!
1201 (?(?{ $+{_heredoc_indented} }) \h*+ ) # An indent (if it was a <<~)
1202 \g{_heredoc_terminator} # The terminator
1203 (?: \n | \z ) # At an end-of-line
1204 )
1205 (?(<PPR_X_HD_nointerp>)
1206 [^\n]*+ \n
1207 |
1208 [^\n\$\@]*+
1209 (?:
1210 (?>
1211 (?{ local $PPR::X::_heredoc_EOL_start = $^R })
1212 (?= \$ ) (?&PerlScalarAccess)
1213 (?{ $PPR::X::_heredoc_EOL_start })
1214 |
1215 (?{ local $PPR::X::_heredoc_EOL_start = $^R })
1216 (?= \@ ) (?&PerlArrayAccess)
1217 (?{ $PPR::X::_heredoc_EOL_start })
1218 )
1219 [^\n\$\@]*+
1220 )*+
1221 \n (??{ $PPR::X::_heredoc_skip{+pos()} // q{} })
1222 )
1223 )*+
1224  
1225 (?(?{ $+{_heredoc_indented} }) \h*+ ) # An indent (if it was a <<~)
1226 \g{_heredoc_terminator} # The specified terminator
1227 (?: \n | \z ) # Followed by EOL
1228 )
1229  
1230 # Then memoize the skip for when it's subsequently needed by PerlOWS or PerlNWS...
1231 (?{
1232 # Split .{N} repetition into multiple repetitions to avoid the 32766 limit...
1233 $PPR::X::_heredoc_skip{$^R} = '(?s:'
1234 . ( '.{32766}' x int((pos() - $^R) / 32766) )
1235 . '.{' . (pos() - $^R) % 32766 . '})';
1236 })
1237 )
1238 )
1239  
1240 )) # End of rule
1241  
1242 (?<PerlQuotelikeQ> (?<PerlStdQuotelikeQ>
1243 (?>
1244 ' [^'\\]*+ (?: \\. [^'\\]*+ )*+ '
1245 |
1246 \b q \b
1247 (?> (?= [#] ) | (?! (?>(?&PerlOWS)) => ) )
1248 (?&PPR_X_quotelike_body)
1249 )
1250 )) # End of rule
1251  
1252 (?<PerlQuotelikeQQ> (?<PerlStdQuotelikeQQ>
1253 (?>
1254 " [^"\\]*+ (?: \\. [^"\\]*+ )*+ "
1255 |
1256 \b qq \b
1257 (?> (?= [#] ) | (?! (?>(?&PerlOWS)) => ) )
1258 (?&PPR_X_quotelike_body_always_interpolated)
1259 )
1260 )) # End of rule
1261  
1262 (?<PerlQuotelikeQW> (?<PerlStdQuotelikeQW>
1263 (?>
1264 qw \b
1265 (?> (?= [#] ) | (?! (?>(?&PerlOWS)) => ) )
1266 (?&PPR_X_quotelike_body)
1267 )
1268 )) # End of rule
1269  
1270 (?<PerlQuotelikeQX> (?<PerlStdQuotelikeQX>
1271 (?>
1272 ` [^`]*+ (?: \\. [^`]*+ )*+ `
1273 |
1274 qx
1275 (?>
1276 (?= (?>(?&PerlOWS)) ' )
1277 (?&PPR_X_quotelike_body)
1278 |
1279 \b (?> (?= [#] ) | (?! (?>(?&PerlOWS)) => ) )
1280 (?&PPR_X_quotelike_body_interpolated)
1281 )
1282 )
1283 )) # End of rule
1284  
1285 (?<PerlQuotelikeS> (?<PerlStdQuotelikeS>
1286 (?<PerlSubstitution> (?<PerlStdSubstitution>
1287 s \b
1288 (?> (?= [#] ) | (?! (?>(?&PerlOWS)) => ) )
1289 (?>
1290 # Hashed syntax...
1291 (?= [#] )
1292 (?>(?&PPR_X_regex_body_interpolated_unclosed))
1293 (?&PPR_X_quotelike_s_e_check)
1294 (?>(?&PPR_X_quotelike_body_interpolated))
1295 |
1296 # Bracketed syntax...
1297 (?= (?>(?&PerlOWS))
1298 (?: [\[(<\{] # )
1299 | (\X) (??{ exists $PPR::X::_QLD_CLOSE_FOR{$^N} ? '' : '(?!)' })
1300 )
1301 )
1302 (?>(?&PPR_X_regex_body_interpolated))
1303 (?>(?&PerlOWS))
1304 (?&PPR_X_quotelike_s_e_check)
1305 (?>(?&PPR_X_quotelike_body_interpolated))
1306 |
1307 # Single-quoted syntax...
1308 (?= (?>(?&PerlOWS)) ' )
1309 (?>(?&PPR_X_regex_body_unclosed))
1310 (?&PPR_X_quotelike_s_e_check)
1311 (?>(?&PPR_X_quotelike_body_interpolated))
1312 |
1313 # Delimited syntax...
1314 (?>(?&PPR_X_regex_body_interpolated_unclosed))
1315 (?&PPR_X_quotelike_s_e_check)
1316 (?>(?&PPR_X_quotelike_body_interpolated))
1317 )
1318 [msixpodualgcern]*+
1319 )) # End of rule
1320 )) # End of rule
1321  
1322 (?<PerlQuotelikeTR> (?<PerlStdQuotelikeTR>
1323 (?<PerlTransliteration> (?<PerlStdTransliteration>
1324 (?> tr | y ) \b
1325 (?! (?>(?&PerlOWS)) => )
1326 (?>
1327 # Hashed syntax...
1328 (?= [#] )
1329 (?>(?&PPR_X_quotelike_body_interpolated_unclosed))
1330 (?&PPR_X_quotelike_body_interpolated)
1331 |
1332 # Bracketed syntax...
1333 (?= (?>(?&PerlOWS))
1334 (?: [\[(<\{\Ā«] # )]
1335 | (\X) (??{ exists $PPR::X::_QLD_CLOSE_FOR{$^N} ? '' : '(?!)' })
1336 )
1337 )
1338 (?>(?&PPR_X_quotelike_body_interpolated))
1339 (?>(?&PerlOWS))
1340 (?&PPR_X_quotelike_body_interpolated)
1341 |
1342 # Delimited syntax...
1343 (?>(?&PPR_X_quotelike_body_interpolated_unclosed))
1344 (?&PPR_X_quotelike_body_interpolated)
1345 )
1346 [cdsr]*+
1347 )) # End of rule
1348 )) # End of rule
1349  
1350 (?<PerlContextualQuotelikeM> (?<PerlStdContextualQuotelikeM>
1351 (?<PerlContextualMatch> (?<PerlStdContextualMatch>
1352 (?<PerlQuotelikeM>
1353 (?<PerlMatch>
1354 (?>
1355 \/\/
1356 |
1357 (?>
1358 m (?= [#] )
1359 |
1360 m \b
1361 (?! (?>(?&PerlOWS)) => )
1362 |
1363 (?= \/ [^/] )
1364 )
1365 (?&PPR_X_regex_body_interpolated)
1366 )
1367 [msixpodualgcn]*+
1368 ) # End of rule (?<PerlMatch>)
1369 ) # End of rule (?<PerlQuotelikeM>)
1370 (?=
1371 (?>(?&PerlOWS))
1372 (?> \z | [,;\}\])?] | => | : (?! :)
1373 | (?&PerlInfixBinaryOperator) | (?&PerlLowPrecedenceInfixOperator)
1374 | (?= \w) (?> for(?:each)?+ | while | if | unless | until | when )
1375 )
1376 )
1377 )) # End of rule
1378 )) # End of rule
1379  
1380 (?<PerlQuotelikeQR> (?<PerlStdQuotelikeQR>
1381 qr \b
1382 (?> (?= [#] ) | (?! (?>(?&PerlOWS)) => ) )
1383 (?>(?&PPR_X_regex_body_interpolated))
1384 [msixpodualn]*+
1385 )) # End of rule
1386  
1387 (?<PerlRegex> (?<PerlStdRegex>
1388 (?>
1389 (?&PerlMatch)
1390 |
1391 (?&PerlQuotelikeQR)
1392 )
1393 )) # End of rule
1394  
1395 (?<PerlContextualRegex> (?<PerlStdContextualRegex>
1396 (?>
1397 (?&PerlContextualMatch)
1398 |
1399 (?&PerlQuotelikeQR)
1400 )
1401 )) # End of rule
1402  
1403  
1404 (?<PerlBuiltinFunction> (?<PerlStdBuiltinFunction>
1405 # Optimized to match any Perl builtin name, without backtracking...
1406 (?=[^\W\d]) # Skip if possible
1407 (?>
1408 s(?>e(?>t(?>(?>(?>(?>hos|ne)t|gr)en|s(?>erven|ockop))t|p(?>r(?>iority|otoent)|went|grp))|m(?>ctl|get|op)|ek(?>dir)?|lect|nd)|y(?>s(?>write|call|open|read|seek|tem)|mlink)|h(?>m(?>write|read|ctl|get)|utdown|ift)|o(?>cket(?>pair)?|rt)|p(?>li(?>ce|t)|rintf)|(?>cala|ubst)r|t(?>at|udy)|leep|rand|qrt|ay|in)
1409 | g(?>et(?>p(?>r(?>oto(?>byn(?>umber|ame)|ent)|iority)|w(?>ent|nam|uid)|eername|grp|pid)|s(?>erv(?>by(?>name|port)|ent)|ock(?>name|opt))|host(?>by(?>addr|name)|ent)|net(?>by(?>addr|name)|ent)|gr(?>ent|gid|nam)|login|c)|mtime|lob|oto|rep)
1410 | r(?>e(?>ad(?>lin[ek]|pipe|dir)?|(?>quir|vers|nam)e|winddir|turn|set|cv|do|f)|index|mdir|and)
1411 | c(?>h(?>o(?>m?p|wn)|r(?>oot)?|dir|mod)|o(?>n(?>tinue|nect)|s)|lose(?>dir)?|aller|rypt)
1412 | e(?>nd(?>(?>hos|ne)t|p(?>roto|w)|serv|gr)ent|x(?>i(?>sts|t)|ec|p)|ach|val(?>bytes)?+|of)
1413 | l(?>o(?>c(?>al(?>time)?|k)|g)|i(?>sten|nk)|(?>sta|as)t|c(?>first)?|ength)
1414 | u(?>n(?>(?>lin|pac)k|shift|def|tie)|c(?>first)?|mask|time)
1415 | p(?>r(?>ototype|intf?)|ack(?>age)?|o[ps]|ipe|ush)
1416 | d(?>bm(?>close|open)|e(?>fined|lete)|ump|ie|o)
1417 | f(?>or(?>m(?>line|at)|k)|ileno|cntl|c|lock)
1418 | t(?>i(?>mes?|ed?)|ell(?>dir)?|runcate)
1419 | w(?>a(?>it(?>pid)?|ntarray|rn)|rite)
1420 | m(?>sg(?>ctl|get|rcv|snd)|kdir|ap)
1421 | b(?>in(?>mode|d)|less|reak)
1422 | i(?>n(?>dex|t)|mport|octl)
1423 | a(?>ccept|larm|tan2|bs)
1424 | o(?>pen(?>dir)?|ct|rd)
1425 | v(?>alues|ec)
1426 | k(?>eys|ill)
1427 | quotemeta
1428 | join
1429 | next
1430 | hex
1431 | _
1432 )
1433 \b
1434 )) # End of rule
1435  
1436 (?<PerlNullaryBuiltinFunction> (?<PerlStdNullaryBuiltinFunction>
1437 # Optimized to match any Perl builtin name, without backtracking...
1438 (?= [^\W\d] ) # Skip if possible
1439 (?>
1440 get(?:(?:(?:hos|ne)t|serv|gr)ent|p(?:(?:roto|w)ent|pid)|login)
1441 | end(?:(?:hos|ne)t|p(?:roto|w)|serv|gr)ent
1442 | wa(?:ntarray|it)
1443 | times?
1444 | fork
1445 | _
1446 )
1447 \b
1448 )) # End of rule
1449  
1450 (?<PerlVersionNumber> (?<PerlStdVersionNumber>
1451 (?>
1452 (?&PerlVString)
1453 |
1454 (?>(?&PPR_X_digit_seq))
1455 (?: \. (?&PPR_X_digit_seq)?+ )*+
1456 )
1457 )) # End of rule
1458  
1459 (?<PerlVString> (?<PerlStdVString>
1460 v (?>(?&PPR_X_digit_seq)) (?: \. (?&PPR_X_digit_seq) )*+
1461 )) # End of rule
1462  
1463 (?<PerlNumber> (?<PerlStdNumber>
1464 [+-]?+
1465 (?>
1466 0 (?> x (?&PPR_X_x_digit_seq)
1467 | b (?&PPR_X_b_digit_seq)
1468 | o? (?&PPR_X_o_digit_seq)
1469 )
1470 |
1471 (?>
1472 (?>(?&PPR_X_digit_seq))
1473 (?: \. (?&PPR_X_digit_seq)?+ )?+
1474 |
1475 \. (?&PPR_X_digit_seq)
1476 )
1477 (?: [eE] [+-]?+ (?&PPR_X_digit_seq) )?+
1478 )
1479 )) # End of rule
1480  
1481 (?<PerlOldQualifiedIdentifier> (?<PerlStdOldQualifiedIdentifier>
1482 (?> (?> :: | ' ) \w++ | [^\W\d]\w*+ ) (?: (?> :: | ' ) \w++ )*+
1483 )) # End of rule
1484  
1485 (?<PerlQualifiedIdentifier> (?<PerlStdQualifiedIdentifier>
1486 (?> :: \w++ | [^\W\d]\w*+ ) (?: (?> :: | ' ) \w++ )*+
1487 )) # End of rule
1488  
1489 (?<PerlIdentifier> (?<PerlStdIdentifier>
1490 [^\W\d]\w*+
1491 )) # End of rule
1492  
1493 (?<PerlBareword> (?<PerlStdBareword>
1494 (?! (?> (?= \w )
1495 (?> for(?:each)?+ | while | if | unless | until | use | no
1496 | given | when | sub | return | my | our | state
1497 | try | catch | finally | defer
1498 )
1499 | (?&PPR_X_named_op)
1500 | __ (?> END | DATA ) __ \b
1501 ) \b
1502 (?! (?>(?&PerlOWS)) => )
1503 )
1504 (?! (?> q[qwrx]?+ | [mys] | tr ) \b
1505 (?> (?= [#] ) | (?! (?>(?&PerlOWS)) => ) )
1506 )
1507 (?: :: )?+
1508 [^\W\d]\w*+
1509 (?: (?: :: | ' ) [^\W\d]\w*+ )*+
1510 (?: :: )?+
1511 (?! \( ) # )
1512 |
1513 :: (?! \w | \{ )
1514 )) # End of rule
1515  
1516 (?<PerlKeyword> (?<PerlStdKeyword>
1517 (?!) # None, by default, but can be overridden in a composing regex
1518 )) # End of rule
1519  
1520 (?<PerlPodSequence> (?<PerlStdPodSequence>
1521 (?>(?&PerlOWS)) (?: (?>(?&PerlPod)) (?&PerlOWS) )*+
1522 )) # End of rule
1523  
1524 (?<PerlPod> (?<PerlStdPod>
1525 ^ = [^\W\d]\w*+ # A line starting with =<identifier>
1526 .*? # Up to the first...
1527 (?>
1528 ^ = cut \b [^\n]*+ $ # ...line starting with =cut
1529 | # or
1530 \z # ...EOF
1531 )
1532 )) # End of rule
1533  
1534  
1535 ##### Whitespace matching (part of API) #################################
1536  
1537 (?<PerlOWSOrEND> (?<PerlStdOWSOrEND>
1538 (?:
1539 \h++
1540 |
1541 (?&PPR_X_newline_and_heredoc)
1542 |
1543 (?&PerlComment)
1544 |
1545 __ (?> END | DATA ) __ \b .*+ \z
1546 )*+
1547 )) # End of rule
1548  
1549 (?<PerlOWS> (?<PerlStdOWS>
1550 (?:
1551 \h++
1552 |
1553 (?&PPR_X_newline_and_heredoc)
1554 |
1555 (?&PerlComment)
1556 )*+
1557 )) # End of rule
1558  
1559 (?<PerlNWS> (?<PerlStdNWS>
1560 (?:
1561 \h++
1562 |
1563 (?&PPR_X_newline_and_heredoc)
1564 |
1565 (?&PerlComment)
1566 )++
1567 )) # End of rule
1568  
1569 (?<PerlComment> (?<PerlStdComment>
1570 [#] [^\n]*+
1571 )) # End of rule
1572  
1573 (?<PerlEndOfLine> (?<PerlStdEndOfLine>
1574 \n
1575 )) # End of rule
1576  
1577  
1578 ###### Internal components (not part of API) ##########################
1579  
1580 (?<PPR_X_named_op>
1581 (?> cmp
1582 | [lg][te]
1583 | eq
1584 | ne
1585 | and
1586 | or
1587 | xor
1588 )
1589 ) # End of rule (?<PPR_X_named_op>)
1590  
1591 (?<PPR_X_non_reserved_identifier>
1592 (?! (?>
1593 for(?:each)?+ | while | if | unless | until | given | when | default
1594 | sub | format | use | no | my | our | state
1595 | try | catch | finally | defer
1596 | (?&PPR_X_named_op)
1597 | [msy] | q[wrxq]?+ | tr
1598 | __ (?> END | DATA ) __
1599 )
1600 \b
1601 )
1602 (?>(?&PerlQualifiedIdentifier))
1603 (?! :: )
1604 ) # End of rule (?<PPR_X_non_reserved_identifier>)
1605  
1606 (?<PPR_X_three_part_list>
1607 \( (?>(?&PerlOWS)) (?: (?>(?&PerlExpression)) (?&PerlOWS) )??
1608 ; (?>(?&PerlOWS)) (?: (?>(?&PerlExpression)) (?&PerlOWS) )??
1609 ; (?>(?&PerlOWS)) (?: (?>(?&PerlExpression)) (?&PerlOWS) )??
1610 \)
1611 ) # End of rule (?<PPR_X_three_part_list>)
1612  
1613 (?<PPR_X_indirect_obj>
1614 (?&PerlBareword)
1615 |
1616 (?>(?&PerlVariableScalar))
1617 (?! (?>(?&PerlOWS)) (?> [<\[\{] | -> ) )
1618 ) # End of rule (?<PPR_X_indirect_obj>)
1619  
1620 (?<PPR_X_quotelike_body>
1621 (?>(?&PPR_X_quotelike_body_unclosed))
1622 \S # (Note: Don't have to test that this matches; the preceding subrule already did that)
1623 ) # End of rule (?<PPR_X_quotelike_body>)
1624  
1625 (?<PPR_X_balanced_parens>
1626 [^)(\\\n]*+
1627 (?:
1628 (?>
1629 \\.
1630 |
1631 \( (?>(?&PPR_X_balanced_parens)) \)
1632 |
1633 (?&PPR_X_newline_and_heredoc)
1634 )
1635 [^)(\\\n]*+
1636 )*+
1637 ) # End of rule (?<PPR_X_balanced_parens>)
1638  
1639 (?<PPR_X_balanced_curlies>
1640 [^\}\{\\\n]*+
1641 (?:
1642 (?>
1643 \\.
1644 |
1645 \{ (?>(?&PPR_X_balanced_curlies)) \}
1646 |
1647 (?&PPR_X_newline_and_heredoc)
1648 )
1649 [^\}\{\\\n]*+
1650 )*+
1651 ) # End of rule (?<PPR_X_balanced_curlies>)
1652  
1653 (?<PPR_X_balanced_squares>
1654 [^][\\\n]*+
1655 (?:
1656 (?>
1657 \\.
1658 |
1659 \[ (?&PPR_X_balanced_squares) \]
1660 |
1661 (?&PPR_X_newline_and_heredoc)
1662 )
1663 [^][\\\n]*+
1664 )*+
1665 ) # End of rule (?<PPR_X_balanced_squares>)
1666  
1667 (?<PPR_X_balanced_angles>
1668 [^><\\\n]*+
1669 (?:
1670 (?>
1671 \\.
1672 |
1673 < (?>(?&PPR_X_balanced_angles)) >
1674 |
1675 (?&PPR_X_newline_and_heredoc)
1676 )
1677 [^><\\\n]*+
1678 )*+
1679 ) # End of rule (?<PPR_X_balanced_angles>)
1680  
1681 (?<PPR_X_balanced_unicode_delims>
1682 (??{$PPR::X::_qld_not_special})
1683 (?:
1684 (?>
1685 \\.
1686 |
1687 (??{$PPR::X::_qld_open})
1688 (?>(?&PPR_X_balanced_unicode_delims))
1689 (??{$PPR::X::_qld_close})
1690 |
1691 (?&PPR_X_newline_and_heredoc)
1692 )
1693 (??{$PPR::X::_qld_not_special})
1694 )*+
1695 ) # End of rule (?<PPR_X_balanced_unicode_delims>)
1696  
1697 (?<PPR_X_regex_body_unclosed>
1698 (?>
1699 [#]
1700 [^#\\\n]*+
1701 (?:
1702 (?: \\. | (?&PPR_X_newline_and_heredoc) )
1703 [^#\\\n]*+
1704 )*+
1705 (?= [#] )
1706 |
1707 (?>(?&PerlOWS))
1708 (?>
1709 \{ (?>(?&PPR_X_balanced_curlies)) (?= \} )
1710 |
1711 \[ (?>(?&PPR_X_balanced_squares)) (?= \] )
1712 |
1713 \( (?>
1714 \?{1,2}+ (?= \{ )
1715 (?>(?&PerlBlock))
1716 |
1717 (?! \?{1,2}+ \{ )
1718 (?>(?&PPR_X_balanced_parens))
1719 ) (?= \) )
1720 |
1721 < (?>(?&PPR_X_balanced_angles)) (?= > )
1722 |
1723 (\X) (??{ exists $PPR::X::_QLD_CLOSE_FOR{$^N} ? '' : '(?!)' })
1724 (?{ local $PPR::X::_qld_open = $^N;
1725 local $PPR::X::_qld_close = $PPR::X::_QLD_CLOSE_FOR{$PPR::X::_qld_open};
1726 local $PPR::X::_qld_not_special
1727 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n]*+";
1728 local $PPR::X::_qld_not_special_or_sigil
1729 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n\\\$\\\@]*+";
1730 local $PPR::X::_qld_not_special_in_regex_var
1731 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\s(|)]";
1732 })
1733 (?>(?&PPR_X_balanced_unicode_delims_regex_interpolated))
1734 (?= (??{$PPR::X::_qld_close}) )
1735 |
1736 \\
1737 [^\\\n]*+
1738 (
1739 (?&PPR_X_newline_and_heredoc)
1740 [^\\\n]*+
1741 )*+
1742 (?= \\ )
1743 |
1744 /
1745 [^\\/\n]*+
1746 (?:
1747 (?: \\. | (?&PPR_X_newline_and_heredoc) )
1748 [^\\/\n]*+
1749 )*+
1750 (?= / )
1751 |
1752 (?<PPR_X_qldel> \S )
1753 (?:
1754 \\.
1755 |
1756 (?&PPR_X_newline_and_heredoc)
1757 |
1758 (?! \g{PPR_X_qldel} ) .
1759 )*+
1760 (?= \g{PPR_X_qldel} )
1761 )
1762 )
1763 ) # End of rule (?<PPR_X_regex_body_unclosed>)
1764  
1765 (?<PPR_X_quotelike_body_unclosed>
1766 (?>
1767 [#]
1768 [^#\\\n]*+
1769 (?:
1770 (?: \\. | (?&PPR_X_newline_and_heredoc) )
1771 [^#\\\n]*+
1772 )*+
1773 (?= [#] )
1774 |
1775 (?>(?&PerlOWS))
1776 (?>
1777 \{ (?>(?&PPR_X_balanced_curlies)) (?= \} )
1778 |
1779 \[ (?>(?&PPR_X_balanced_squares)) (?= \] )
1780 |
1781 \( (?>(?&PPR_X_balanced_parens)) (?= \) )
1782 |
1783 < (?>(?&PPR_X_balanced_angles)) (?= > )
1784 |
1785 (\X) (??{ exists $PPR::X::_QLD_CLOSE_FOR{$^N} ? '' : '(?!)' })
1786 (?{ local $PPR::X::_qld_open = $^N;
1787 local $PPR::X::_qld_close = $PPR::X::_QLD_CLOSE_FOR{$PPR::X::_qld_open};
1788 local $PPR::X::_qld_not_special
1789 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n]*+";
1790 local $PPR::X::_qld_not_special_or_sigil
1791 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n\\\$\\\@]*+";
1792 local $PPR::X::_qld_not_special_in_regex_var
1793 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\s(|)]";
1794 })
1795 (?>(?&PPR_X_balanced_unicode_delims))
1796 (?= (??{$PPR::X::_qld_close}) )
1797 |
1798 \\
1799 [^\\\n]*+
1800 (
1801 (?&PPR_X_newline_and_heredoc)
1802 [^\\\n]*+
1803 )*+
1804 (?= \\ )
1805 |
1806 /
1807 [^\\/\n]*+
1808 (?:
1809 (?: \\. | (?&PPR_X_newline_and_heredoc) )
1810 [^\\/\n]*+
1811 )*+
1812 (?= / )
1813 |
1814 (?<PPR_X_qldel> \S )
1815 (?:
1816 \\.
1817 |
1818 (?&PPR_X_newline_and_heredoc)
1819 |
1820 (?! \g{PPR_X_qldel} ) .
1821 )*+
1822 (?= \g{PPR_X_qldel} )
1823 )
1824 )
1825 ) # End of rule (?<PPR_X_quotelike_body_unclosed>)
1826  
1827 (?<PPR_X_quotelike_body_always_interpolated>
1828 (?>(?&PPR_X_quotelike_body_always_interpolated_unclosed))
1829 \S # (Note: Don't have to test that this matches; the preceding subrule already did that)
1830 ) # End of rule (?<PPR_X_quotelike_body_always_interpolated>)
1831  
1832 (?<PPR_X_quotelike_body_interpolated>
1833 (?>(?&PPR_X_quotelike_body_interpolated_unclosed))
1834 \S # (Note: Don't have to test that this matches; the preceding subrule already did that)
1835 ) # End of rule (?<PPR_X_quotelike_body_interpolated>)
1836  
1837 (?<PPR_X_regex_body_interpolated>
1838 (?>(?&PPR_X_regex_body_interpolated_unclosed))
1839 \S # (Note: Don't have to test that this matches; the preceding subrule already did that)
1840 ) # End of rule (?<PPR_X_regex_body_interpolated>)
1841  
1842 (?<PPR_X_balanced_parens_regex_interpolated>
1843 [^)(\\\n\$\@]*+
1844 (?:
1845 (?>
1846 \\.
1847 |
1848 \( (?>(?&PPR_X_balanced_parens_regex_interpolated)) \)
1849 |
1850 (?&PPR_X_newline_and_heredoc)
1851 |
1852 (?= \$ (?! [\s(|)] ) ) (?&PerlScalarAccessNoSpace)
1853 |
1854 (?= \@ (?! [\s(|)] ) ) (?&PerlArrayAccessNoSpace)
1855 |
1856 [\$\@]
1857 )
1858 [^)(\\\n\$\@]*+
1859 )*+
1860 ) # End of rule (?<PPR_X_balanced_parens_regex_interpolated>)
1861  
1862 (?<PPR_X_balanced_curlies_regex_interpolated>
1863 [^\}\{\\\n\$\@]*+
1864 (?:
1865 (?>
1866 \\.
1867 |
1868 \{ (?>(?&PPR_X_balanced_curlies_regex_interpolated)) \}
1869 |
1870 (?&PPR_X_newline_and_heredoc)
1871 |
1872 (?= \$ (?! [\s\}(|)] ) ) (?&PerlScalarAccessNoSpace)
1873 |
1874 (?= \@ (?! [\s\}(|)] ) ) (?&PerlArrayAccessNoSpace)
1875 |
1876 [\$\@]
1877 )
1878 [^\}\{\\\n\$\@]*+
1879 )*+
1880 ) # End of rule (?<PPR_X_balanced_curlies_regex_interpolated>)
1881  
1882 (?<PPR_X_balanced_squares_regex_interpolated>
1883 [^][\\\n\$\@]*+
1884 (?:
1885 (?>
1886 \\.
1887 |
1888 \[ (?>(?&PPR_X_balanced_squares_regex_interpolated)) \]
1889 |
1890 (?&PPR_X_newline_and_heredoc)
1891 |
1892 (?= \$ (?! [\s\](|)] ) ) (?&PerlScalarAccessNoSpace)
1893 |
1894 (?= \@ (?! [\s\](|)] ) ) (?&PerlArrayAccessNoSpace)
1895 |
1896 [\$\@]
1897 )
1898 [^][\\\n\$\@]*+
1899 )*+
1900 ) # End of rule (?<PPR_X_balanced_squares_regex_interpolated>)
1901  
1902 (?<PPR_X_balanced_angles_regex_interpolated>
1903 [^><\\\n\$\@]*+
1904 (?:
1905 (?>
1906 \\.
1907 |
1908 < (?>(?&PPR_X_balanced_angles_regex_interpolated)) >
1909 |
1910 (?&PPR_X_newline_and_heredoc)
1911 |
1912 (?= \$ (?! [\s>(|)] ) ) (?&PerlScalarAccessNoSpace)
1913 |
1914 (?= \@ (?! [\s>(|)] ) ) (?&PerlArrayAccessNoSpace)
1915 |
1916 [\$\@]
1917 )
1918 [^><\\\n\$\@]*+
1919 )*+
1920 ) # End of rule (?<PPR_X_balanced_angles_regex_interpolated>)
1921  
1922  
1923 (?<PPR_X_balanced_unicode_delims_regex_interpolated>
1924 (??{$PPR::X::_qld_not_special_or_sigil})
1925 (?:
1926 (?>
1927 \\.
1928 |
1929 (??{ $PPR::X::_qld_open })
1930 (?>(?&PPR_X_balanced_unicode_delims_regex_interpolated))
1931 (??{ $PPR::X::_qld_close })
1932 |
1933 (?&PPR_X_newline_and_heredoc)
1934 |
1935 (?= \$ (??{ $PPR::X::_qld_not_special_in_regex_var }) )
1936 (?&PerlScalarAccessNoSpace)
1937 |
1938 (?= \$ (??{ $PPR::X::_qld_not_special_in_regex_var }) )
1939 (?&PerlArrayAccessNoSpace)
1940 |
1941 [\$\@]
1942 )
1943 (??{$PPR::X::_qld_not_special_or_sigil})
1944 )*+
1945 ) # End of rule (?<PPR_X_balanced_unicode_delims_regex_interpolated>)
1946  
1947  
1948 (?<PPR_X_balanced_parens_interpolated>
1949 [^)(\\\n\$\@]*+
1950 (?:
1951 (?>
1952 \\.
1953 |
1954 \( (?>(?&PPR_X_balanced_parens_interpolated)) \)
1955 |
1956 (?&PPR_X_newline_and_heredoc)
1957 |
1958 (?= \$ (?! [\s\)] ) ) (?&PerlScalarAccessNoSpace)
1959 |
1960 (?= \@ (?! [\s\)] ) ) (?&PerlArrayAccessNoSpace)
1961 |
1962 [\$\@]
1963 )
1964 [^)(\\\n\$\@]*+
1965 )*+
1966 ) # End of rule (?<PPR_X_balanced_parens_interpolated>)
1967  
1968 (?<PPR_X_balanced_curlies_interpolated>
1969 [^\}\{\\\n\$\@]*+
1970 (?:
1971 (?>
1972 \\.
1973 |
1974 \{ (?>(?&PPR_X_balanced_curlies_interpolated)) \}
1975 |
1976 (?&PPR_X_newline_and_heredoc)
1977 |
1978 (?= \$ (?! [\s\}] ) ) (?&PerlScalarAccessNoSpace)
1979 |
1980 (?= \@ (?! [\s\}] ) ) (?&PerlArrayAccessNoSpace)
1981 |
1982 [\$\@]
1983 )
1984 [^\}\{\\\n\$\@]*+
1985 )*+
1986 ) # End of rule (?<PPR_X_balanced_curlies_interpolated>)
1987  
1988 (?<PPR_X_balanced_squares_interpolated>
1989 [^][\\\n\$\@]*+
1990 (?:
1991 (?>
1992 \\.
1993 |
1994 \[ (?>(?&PPR_X_balanced_squares_interpolated)) \]
1995 |
1996 (?&PPR_X_newline_and_heredoc)
1997 |
1998 (?= \$ (?! [\s\]] ) ) (?&PerlScalarAccessNoSpace)
1999 |
2000 (?= \@ (?! [\s\]] ) ) (?&PerlArrayAccessNoSpace)
2001 |
2002 [\$\@]
2003 )
2004 [^][\\\n\$\@]*+
2005 )*+
2006 ) # End of rule (?<PPR_X_balanced_squares_interpolated>)
2007  
2008 (?<PPR_X_balanced_unicode_delims_interpolated>
2009 (??{$PPR::X::_qld_not_special_or_sigil})
2010 (?:
2011 (?>
2012 \\.
2013 |
2014 (??{$PPR::X::_qld_open})
2015 (?>(?&PPR_X_balanced_unicode_delims_interpolated))
2016 (??{$PPR::X::_qld_close})
2017 |
2018 (?&PPR_X_newline_and_heredoc)
2019 |
2020 (?= \$ (?! \s | (??{$PPR::X::_qld_close}) ) ) (?&PerlScalarAccessNoSpace)
2021 |
2022 (?= \@ (?! \s | (??{$PPR::X::_qld_close}) ) ) (?&PerlArrayAccessNoSpace)
2023 |
2024 [\$\@]
2025 )
2026 (??{$PPR::X::_qld_not_special_or_sigil})
2027 )*+
2028 ) # End of rule (?<PPR_X_balanced_unicode_delims_interpolated>)
2029  
2030 (?<PPR_X_balanced_angles_interpolated>
2031 [^><\\\n\$\@]*+
2032 (?:
2033 (?>
2034 \\.
2035 |
2036 < (?>(?&PPR_X_balanced_angles_interpolated)) >
2037 |
2038 (?&PPR_X_newline_and_heredoc)
2039 |
2040 (?= \$ (?! [\s>] ) ) (?&PerlScalarAccessNoSpace)
2041 |
2042 (?= \@ (?! [\s>] ) ) (?&PerlArrayAccessNoSpace)
2043 |
2044 [\$\@]
2045 )
2046 [^><\\\n\$\@]*+
2047 )*+
2048 ) # End of rule (?<PPR_X_balanced_angles_interpolated>)
2049  
2050 (?<PPR_X_regex_body_interpolated_unclosed>
2051 # Start by working out where it actually ends (ignoring interpolations)...
2052 (?=
2053 (?>
2054 [#]
2055 [^#\\\n\$\@]*+
2056 (?:
2057 (?>
2058 \\.
2059 |
2060 (?&PPR_X_newline_and_heredoc)
2061 |
2062 (?= \$ (?! [\s#|()] ) ) (?&PerlScalarAccessNoSpace)
2063 |
2064 (?= \@ (?! [\s#|()] ) ) (?&PerlArrayAccessNoSpace)
2065 |
2066 [\$\@]
2067 )
2068 [^#\\\n\$\@]*+
2069 )*+
2070 (?= [#] )
2071 |
2072 (?>(?&PerlOWS))
2073 (?>
2074 \{ (?>(?&PPR_X_balanced_curlies_regex_interpolated)) (?= \} )
2075 |
2076 \[ (?>(?&PPR_X_balanced_squares_regex_interpolated)) (?= \] )
2077 |
2078 \( (?>(?&PPR_X_balanced_parens_regex_interpolated)) (?= \) )
2079 |
2080 < (?>(?&PPR_X_balanced_angles_regex_interpolated)) (?= > )
2081 |
2082 (\X) (??{ exists $PPR::X::_QLD_CLOSE_FOR{$^N} ? '' : '(?!)' })
2083 (?{ local $PPR::X::_qld_open = $^N;
2084 local $PPR::X::_qld_close = $PPR::X::_QLD_CLOSE_FOR{$PPR::X::_qld_open};
2085 local $PPR::X::_qld_not_special
2086 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n]*+";
2087 local $PPR::X::_qld_not_special_or_sigil
2088 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n\\\$\\\@]*+";
2089 local $PPR::X::_qld_not_special_in_regex_var
2090 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\s(|)]";
2091 })
2092 (?>(?&PPR_X_balanced_unicode_delims_regex_interpolated))
2093 (?= (??{$PPR::X::_qld_close}) )
2094 |
2095 '
2096 [^'\n]*+
2097 (?:
2098 (?> (?&PPR_X_newline_and_heredoc))
2099 [^'\n]*+
2100 )*+
2101 (?= ' )
2102 |
2103 \\
2104 [^\\\n\$\@]*+
2105 (?:
2106 (?>
2107 (?&PPR_X_newline_and_heredoc)
2108 |
2109 (?= \$ (?! [\s\\|()] ) ) (?&PerlScalarAccessNoSpace)
2110 |
2111 (?= \@ (?! [\s\\|()] ) ) (?&PerlArrayAccessNoSpace)
2112 |
2113 [\$\@]
2114 )
2115 [^\\\n\$\@]*+
2116 )*+
2117 (?= \\ )
2118 |
2119 /
2120 [^\\/\n\$\@]*+
2121 (?:
2122 (?>
2123 \\.
2124 |
2125 (?&PPR_X_newline_and_heredoc)
2126 |
2127 (?= \$ (?! [\s/|()] ) ) (?&PerlScalarAccessNoSpace)
2128 |
2129 (?= \@ (?! [\s/|()] ) ) (?&PerlArrayAccessNoSpace)
2130 |
2131 [\$\@]
2132 )
2133 [^\\/\n\$\@]*+
2134 )*+
2135 (?= / )
2136 |
2137 -
2138 (?:
2139 \\.
2140 |
2141 (?&PPR_X_newline_and_heredoc)
2142 |
2143 (?:
2144 (?= \$ (?! [\s|()-] ) ) (?&PerlScalarAccessNoSpaceNoArrow)
2145 |
2146 (?= \@ (?! [\s|()-] ) ) (?&PerlArrayAccessNoSpaceNoArrow)
2147 |
2148 [^-]
2149 )
2150 )*+
2151 (?= - )
2152 |
2153 (?<PPR_X_qldel> \S )
2154 (?:
2155 \\.
2156 |
2157 (?&PPR_X_newline_and_heredoc)
2158 |
2159 (?! \g{PPR_X_qldel} )
2160 (?:
2161 (?= \$ (?! \g{PPR_X_qldel} | [\s|()] ) ) (?&PerlScalarAccessNoSpace)
2162 |
2163 (?= \@ (?! \g{PPR_X_qldel} | [\s|()] ) ) (?&PerlArrayAccessNoSpace)
2164 |
2165 .
2166 )
2167 )*+
2168 (?= \g{PPR_X_qldel} )
2169 )
2170 )
2171 )
2172  
2173 (?&PPR_X_regex_body_unclosed)
2174 ) # End of rule (?<PPR_X_regex_body_interpolated_unclosed>)
2175  
2176 (?<PPR_X_quotelike_body_always_interpolated_unclosed>
2177 # Start by working out where it actually ends (ignoring interpolations)...
2178 (?=
2179 (?>
2180 [#]
2181 [^#\\\n\$\@]*+
2182 (?:
2183 (?>
2184 \\.
2185 |
2186 (?&PPR_X_newline_and_heredoc)
2187 |
2188 (?= \$ (?! [\s#] ) ) (?&PerlScalarAccessNoSpace)
2189 |
2190 (?= \@ (?! [\s#] ) ) (?&PerlArrayAccessNoSpace)
2191 |
2192 [\$\@]
2193 )
2194 [^#\\\n\$\@]*+
2195 )*+
2196 (?= [#] )
2197 |
2198 (?>(?&PerlOWS))
2199 (?>
2200 \{ (?>(?&PPR_X_balanced_curlies_interpolated)) (?= \} )
2201 |
2202 \[ (?>(?&PPR_X_balanced_squares_interpolated)) (?= \] )
2203 |
2204 \( (?>(?&PPR_X_balanced_parens_interpolated)) (?= \) )
2205 |
2206 < (?>(?&PPR_X_balanced_angles_interpolated)) (?= > )
2207 |
2208 (\X) (??{ exists $PPR::X::_QLD_CLOSE_FOR{$^N} ? '' : '(?!)' })
2209 (?{ local $PPR::X::_qld_open = $^N;
2210 local $PPR::X::_qld_close = $PPR::X::_QLD_CLOSE_FOR{$PPR::X::_qld_open};
2211 local $PPR::X::_qld_not_special
2212 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n]*+";
2213 local $PPR::X::_qld_not_special_or_sigil
2214 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n\\\$\\\@]*+";
2215 local $PPR::X::_qld_not_special_in_regex_var
2216 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\s(|)]";
2217 })
2218 (?>(?&PPR_X_balanced_unicode_delims_interpolated))
2219 (?= (??{$PPR::X::_qld_close}) )
2220 |
2221 \\
2222 [^\\\n\$\@]*+
2223 (?:
2224 (?>
2225 (?&PPR_X_newline_and_heredoc)
2226 |
2227 (?= \$ (?! [\s\\] ) ) (?&PerlScalarAccessNoSpace)
2228 |
2229 (?= \@ (?! [\s\\] ) ) (?&PerlArrayAccessNoSpace)
2230 |
2231 [\$\@]
2232 )
2233 [^\\\n\$\@]*+
2234 )*+
2235 (?= \\ )
2236 |
2237 /
2238 [^\\/\n\$\@]*+
2239 (?:
2240 (?>
2241 \\.
2242 |
2243 (?&PPR_X_newline_and_heredoc)
2244 |
2245 (?= \$ (?! [\s/] ) ) (?&PerlScalarAccessNoSpace)
2246 |
2247 (?= \@ (?! [\s/] ) ) (?&PerlArrayAccessNoSpace)
2248 |
2249 [\$\@]
2250 )
2251 [^\\/\n\$\@]*+
2252 )*+
2253 (?= / )
2254 |
2255 -
2256 (?:
2257 \\.
2258 |
2259 (?&PPR_X_newline_and_heredoc)
2260 |
2261 (?:
2262 (?= \$ (?! [\s-] ) ) (?&PerlScalarAccessNoSpaceNoArrow)
2263 |
2264 (?= \@ (?! [\s-] ) ) (?&PerlArrayAccessNoSpaceNoArrow)
2265 |
2266 [^-]
2267 )
2268 )*+
2269 (?= - )
2270 |
2271 (?<PPR_X_qldel> \S )
2272 (?:
2273 \\.
2274 |
2275 (?&PPR_X_newline_and_heredoc)
2276 |
2277 (?! \g{PPR_X_qldel} )
2278 (?:
2279 (?= \$ (?! \g{PPR_X_qldel} | \s ) ) (?&PerlScalarAccessNoSpace)
2280 |
2281 (?= \@ (?! \g{PPR_X_qldel} | \s ) ) (?&PerlArrayAccessNoSpace)
2282 |
2283 .
2284 )
2285 )*+
2286 (?= \g{PPR_X_qldel} )
2287 )
2288 )
2289 )
2290  
2291 (?&PPR_X_quotelike_body_unclosed)
2292 ) # End of rule (?<PPR_X_quotelike_body_always_interpolated_unclosed>)
2293  
2294 (?<PPR_X_quotelike_body_interpolated_unclosed>
2295 # Start by working out where it actually ends (ignoring interpolations)...
2296 (?=
2297 (?>
2298 [#]
2299 [^#\\\n\$\@]*+
2300 (?:
2301 (?>
2302 \\.
2303 |
2304 (?&PPR_X_newline_and_heredoc)
2305 |
2306 (?= \$ (?! [\s#] ) ) (?&PerlScalarAccessNoSpace)
2307 |
2308 (?= \@ (?! [\s#] ) ) (?&PerlArrayAccessNoSpace)
2309 |
2310 [\$\@]
2311 )
2312 [^#\\\n\$\@]*+
2313 )*+
2314 (?= [#] )
2315 |
2316 (?>(?&PerlOWS))
2317 (?>
2318 \{ (?>(?&PPR_X_balanced_curlies_interpolated)) (?= \} )
2319 |
2320 \[ (?>(?&PPR_X_balanced_squares_interpolated)) (?= \] )
2321 |
2322 \( (?>(?&PPR_X_balanced_parens_interpolated)) (?= \) )
2323 |
2324 < (?>(?&PPR_X_balanced_angles_interpolated)) (?= > )
2325 |
2326 (\X) (??{ exists $PPR::X::_QLD_CLOSE_FOR{$^N} ? '' : '(?!)' })
2327 (?{ local $PPR::X::_qld_open = $^N;
2328 local $PPR::X::_qld_close = $PPR::X::_QLD_CLOSE_FOR{$PPR::X::_qld_open};
2329 local $PPR::X::_qld_not_special
2330 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n]*+";
2331 local $PPR::X::_qld_not_special_or_sigil
2332 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n\\\$\\\@]*+";
2333 local $PPR::X::_qld_not_special_in_regex_var
2334 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\s(|)]";
2335 })
2336 (?>(?&PPR_X_balanced_unicode_delims_interpolated))
2337 (?= (??{$PPR::X::_qld_close}) )
2338 |
2339 '
2340 [^'\n]*+
2341 (?:
2342 (?> (?&PPR_X_newline_and_heredoc))
2343 [^'\n]*+
2344 )*+
2345 (?= ' )
2346 |
2347 \\
2348 [^\\\n\$\@]*+
2349 (?:
2350 (?>
2351 (?&PPR_X_newline_and_heredoc)
2352 |
2353 (?= \$ (?! [\s\\] ) ) (?&PerlScalarAccessNoSpace)
2354 |
2355 (?= \@ (?! [\s\\] ) ) (?&PerlArrayAccessNoSpace)
2356 |
2357 [\$\@]
2358 )
2359 [^\\\n\$\@]*+
2360 )*+
2361 (?= \\ )
2362 |
2363 /
2364 [^\\/\n\$\@]*+
2365 (?:
2366 (?>
2367 \\.
2368 |
2369 (?&PPR_X_newline_and_heredoc)
2370 |
2371 (?= \$ (?! [\s/] ) ) (?&PerlScalarAccessNoSpace)
2372 |
2373 (?= \@ (?! [\s/] ) ) (?&PerlArrayAccessNoSpace)
2374 |
2375 [\$\@]
2376 )
2377 [^\\/\n\$\@]*+
2378 )*+
2379 (?= / )
2380 |
2381 -
2382 (?:
2383 \\.
2384 |
2385 (?&PPR_X_newline_and_heredoc)
2386 |
2387 (?:
2388 (?= \$ (?! [\s-] ) ) (?&PerlScalarAccessNoSpaceNoArrow)
2389 |
2390 (?= \@ (?! [\s-] ) ) (?&PerlArrayAccessNoSpaceNoArrow)
2391 |
2392 [^-]
2393 )
2394 )*+
2395 (?= - )
2396 |
2397 (?<PPR_X_qldel> \S )
2398 (?:
2399 \\.
2400 |
2401 (?&PPR_X_newline_and_heredoc)
2402 |
2403 (?! \g{PPR_X_qldel} )
2404 (?:
2405 (?= \$ (?! \g{PPR_X_qldel} | \s ) ) (?&PerlScalarAccessNoSpace)
2406 |
2407 (?= \@ (?! \g{PPR_X_qldel} | \s ) ) (?&PerlArrayAccessNoSpace)
2408 |
2409 .
2410 )
2411 )*+
2412 (?= \g{PPR_X_qldel} )
2413 )
2414 )
2415 )
2416  
2417 (?&PPR_X_quotelike_body_unclosed)
2418 ) # End of rule (?<PPR_X_quotelike_body_interpolated_unclosed>)
2419  
2420 (?<PPR_X_quotelike_s_e_check>
2421 (??{ local $PPR::X::_quotelike_s_end = -1; '' })
2422 (?:
2423 (?=
2424 (?&PPR_X_quotelike_body_interpolated)
2425 (??{ $PPR::X::_quotelike_s_end = +pos(); '' })
2426 [msixpodualgcrn]*+ e [msixpodualgcern]*+
2427 )
2428 (?=
2429 \S # Skip the left delimiter
2430 (?(?{ $PPR::X::_quotelike_s_end >= 0 })
2431 (?>
2432 (??{ +pos() && +pos() < $PPR::X::_quotelike_s_end ? '' : '(?!)' })
2433 (?>
2434 (?&PerlExpression)
2435 |
2436 \\?+ .
2437 )
2438 )*+
2439 )
2440 )
2441 )?+
2442 ) # End of rule (?<PPR_X_quotelike_s_e_check>)
2443  
2444 (?<PPR_X_quotelike_s_e_check_uninterpolated>
2445 (??{ local $PPR::X::_quotelike_s_end = -1; '' })
2446 (?:
2447 (?=
2448 (?&PPR_X_quotelike_body)
2449 (??{ $PPR::X::_quotelike_s_end = +pos(); '' })
2450 [msixpodualgcrn]*+ e [msixpodualgcern]*+
2451 )
2452 (?=
2453 \S # Skip the left delimiter
2454 (?(?{ $PPR::X::_quotelike_s_end >= 0 })
2455 (?>
2456 (??{ +pos() && +pos() < $PPR::X::_quotelike_s_end ? '' : '(?!)' })
2457 (?>
2458 (?&PerlExpression)
2459 |
2460 \\?+ .
2461 )
2462 )*+
2463 )
2464 )
2465 )?+
2466 ) # End of rule (?<PPR_X_quotelike_s_e_check_uninterpolated>)
2467  
2468 (?<PPR_X_filetest_name> [ABCMORSTWXbcdefgkloprstuwxz] )
2469  
2470 (?<PPR_X_digit_seq> \d++ (?: _?+ \d++ )*+ )
2471 (?<PPR_X_x_digit_seq> [\da-fA-F]++ (?: _?+ [\da-fA-F]++ )*+ )
2472 (?<PPR_X_o_digit_seq> [0-7]++ (?: _?+ [0-7]++ )*+ )
2473 (?<PPR_X_b_digit_seq> [0-1]++ (?: _?+ [0-1]++ )*+ )
2474  
2475 (?<PPR_X_newline_and_heredoc>
2476 \n (??{ ($PPR::X::_heredoc_origin // q{}) eq ($_//q{}) ? ($PPR::X::_heredoc_skip{+pos()} // q{}) : q{} })
2477 ) # End of rule (?<PPR_X_newline_and_heredoc>)
2478 )
2479 # END OF GRAMMAR
2480 7 }xms;
2481  
2482  
2483 7 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
2484 7 %PPR::X::_QLD_CLOSE_FOR = (
2485 # "\x{0028}" => "\x{0029}", # LEFT/RIGHT PARENTHESIS
2486 # "\x{003C}" => "\x{003E}", # LESS-THAN/GREATER-THAN SIGN
2487 # "\x{005B}" => "\x{005D}", # LEFT/RIGHT SQUARE BRACKET
2488 # "\x{007B}" => "\x{007D}", # LEFT/RIGHT CURLY BRACKET
2489 "\x{00AB}" => "\x{00BB}", # LEFT/RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
2490 "\x{00BB}" => "\x{00AB}", # RIGHT/LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
2491 "\x{0706}" => "\x{0707}", # SYRIAC COLON SKEWED LEFT/RIGHT
2492 "\x{0F3A}" => "\x{0F3B}", # TIBETAN MARK GUG RTAGS GYON, TIBETAN MARK GUG RTAGS GYAS
2493 "\x{0F3C}" => "\x{0F3D}", # TIBETAN MARK ANG KHANG GYON, TIBETAN MARK ANG KHANG GYAS
2494 "\x{169B}" => "\x{169C}", # OGHAM FEATHER MARK, OGHAM REVERSED FEATHER MARK
2495 "\x{2018}" => "\x{2019}", # LEFT/RIGHT SINGLE QUOTATION MARK
2496 "\x{2019}" => "\x{2018}", # RIGHT/LEFT SINGLE QUOTATION MARK
2497 "\x{201C}" => "\x{201D}", # LEFT/RIGHT DOUBLE QUOTATION MARK
2498 "\x{201D}" => "\x{201C}", # RIGHT/LEFT DOUBLE QUOTATION MARK
2499 "\x{2035}" => "\x{2032}", # REVERSED PRIME, PRIME
2500 "\x{2036}" => "\x{2033}", # REVERSED DOUBLE PRIME, DOUBLE PRIME
2501 "\x{2037}" => "\x{2034}", # REVERSED TRIPLE PRIME, TRIPLE PRIME
2502 "\x{2039}" => "\x{203A}", # SINGLE LEFT/RIGHT-POINTING ANGLE QUOTATION MARK
2503 "\x{203A}" => "\x{2039}", # SINGLE RIGHT/LEFT-POINTING ANGLE QUOTATION MARK
2504 "\x{2045}" => "\x{2046}", # LEFT/RIGHT SQUARE BRACKET WITH QUILL
2505 "\x{204D}" => "\x{204C}", # BLACK RIGHT/LEFTWARDS BULLET
2506 "\x{207D}" => "\x{207E}", # SUPERSCRIPT LEFT/RIGHT PARENTHESIS
2507 "\x{208D}" => "\x{208E}", # SUBSCRIPT LEFT/RIGHT PARENTHESIS
2508 "\x{2192}" => "\x{2190}", # RIGHT/LEFTWARDS ARROW
2509 "\x{219B}" => "\x{219A}", # RIGHT/LEFTWARDS ARROW WITH STROKE
2510 "\x{219D}" => "\x{219C}", # RIGHT/LEFTWARDS WAVE ARROW
2511 "\x{21A0}" => "\x{219E}", # RIGHT/LEFTWARDS TWO HEADED ARROW
2512 "\x{21A3}" => "\x{21A2}", # RIGHT/LEFTWARDS ARROW WITH TAIL
2513 "\x{21A6}" => "\x{21A4}", # RIGHT/LEFTWARDS ARROW FROM BAR
2514 "\x{21AA}" => "\x{21A9}", # RIGHT/LEFTWARDS ARROW WITH HOOK
2515 "\x{21AC}" => "\x{21AB}", # RIGHT/LEFTWARDS ARROW WITH LOOP
2516 "\x{21B1}" => "\x{21B0}", # UPWARDS ARROW WITH TIP RIGHT/LEFTWARDS
2517 "\x{21B3}" => "\x{21B2}", # DOWNWARDS ARROW WITH TIP RIGHT/LEFTWARDS
2518 "\x{21C0}" => "\x{21BC}", # RIGHT/LEFTWARDS HARPOON WITH BARB UPWARDS
2519 "\x{21C1}" => "\x{21BD}", # RIGHT/LEFTWARDS HARPOON WITH BARB DOWNWARDS
2520 "\x{21C9}" => "\x{21C7}", # RIGHT/LEFTWARDS PAIRED ARROWS
2521 "\x{21CF}" => "\x{21CD}", # RIGHT/LEFTWARDS DOUBLE ARROW WITH STROKE
2522 "\x{21D2}" => "\x{21D0}", # RIGHT/LEFTWARDS DOUBLE ARROW
2523 "\x{21DB}" => "\x{21DA}", # RIGHT/LEFTWARDS TRIPLE ARROW
2524 "\x{21DD}" => "\x{21DC}", # RIGHT/LEFTWARDS SQUIGGLE ARROW
2525 "\x{21E2}" => "\x{21E0}", # RIGHT/LEFTWARDS DASHED ARROW
2526 "\x{21E5}" => "\x{21E4}", # RIGHT/LEFTWARDS ARROW TO BAR
2527 "\x{21E8}" => "\x{21E6}", # RIGHT/LEFTWARDS WHITE ARROW
2528 "\x{21F4}" => "\x{2B30}", # RIGHT/LEFT ARROW WITH SMALL CIRCLE
2529 "\x{21F6}" => "\x{2B31}", # THREE RIGHT/LEFTWARDS ARROWS
2530 "\x{21F8}" => "\x{21F7}", # RIGHT/LEFTWARDS ARROW WITH VERTICAL STROKE
2531 "\x{21FB}" => "\x{21FA}", # RIGHT/LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE
2532 "\x{21FE}" => "\x{21FD}", # RIGHT/LEFTWARDS OPEN-HEADED ARROW
2533 "\x{2208}" => "\x{220B}", # ELEMENT OF, CONTAINS AS MEMBER
2534 "\x{2209}" => "\x{220C}", # NOT AN ELEMENT OF, DOES NOT CONTAIN AS MEMBER
2535 "\x{220A}" => "\x{220D}", # SMALL ELEMENT OF, SMALL CONTAINS AS MEMBER
2536 "\x{2264}" => "\x{2265}", # LESS-THAN/GREATER-THAN OR EQUAL TO
2537 "\x{2266}" => "\x{2267}", # LESS-THAN/GREATER-THAN OVER EQUAL TO
2538 "\x{2268}" => "\x{2269}", # LESS-THAN/GREATER-THAN BUT NOT EQUAL TO
2539 "\x{226A}" => "\x{226B}", # MUCH LESS-THAN/GREATER-THAN
2540 "\x{226E}" => "\x{226F}", # NOT LESS-THAN/GREATER-THAN
2541 "\x{2270}" => "\x{2271}", # NEITHER LESS-THAN/GREATER-THAN NOR EQUAL TO
2542 "\x{2272}" => "\x{2273}", # LESS-THAN/GREATER-THAN OR EQUIVALENT TO
2543 "\x{2274}" => "\x{2275}", # NEITHER LESS-THAN/GREATER-THAN NOR EQUIVALENT TO
2544 "\x{227A}" => "\x{227B}", # PRECEDES/SUCCEEDS
2545 "\x{227C}" => "\x{227D}", # PRECEDES/SUCCEEDS OR EQUAL TO
2546 "\x{227E}" => "\x{227F}", # PRECEDES/SUCCEEDS OR EQUIVALENT TO
2547 "\x{2280}" => "\x{2281}", # DOES NOT PRECEDE/SUCCEED
2548 "\x{2282}" => "\x{2283}", # SUBSET/SUPERSET OF
2549 "\x{2284}" => "\x{2285}", # NOT A SUBSET/SUPERSET OF
2550 "\x{2286}" => "\x{2287}", # SUBSET/SUPERSET OF OR EQUAL TO
2551 "\x{2288}" => "\x{2289}", # NEITHER A SUBSET/SUPERSET OF NOR EQUAL TO
2552 "\x{228A}" => "\x{228B}", # SUBSET/SUPERSET OF WITH NOT EQUAL TO
2553 "\x{22A3}" => "\x{22A2}", # LEFT/RIGHT TACK
2554 "\x{22A6}" => "\x{2ADE}", # ASSERTION, SHORT LEFT TACK
2555 "\x{22A8}" => "\x{2AE4}", # TRUE, VERTICAL BAR DOUBLE LEFT TURNSTILE
2556 "\x{22A9}" => "\x{2AE3}", # FORCES, DOUBLE VERTICAL BAR LEFT TURNSTILE
2557 "\x{22B0}" => "\x{22B1}", # PRECEDES/SUCCEEDS UNDER RELATION
2558 "\x{22D0}" => "\x{22D1}", # DOUBLE SUBSET/SUPERSET
2559 "\x{22D6}" => "\x{22D7}", # LESS-THAN/GREATER-THAN WITH DOT
2560 "\x{22D8}" => "\x{22D9}", # VERY MUCH LESS-THAN/GREATER-THAN
2561 "\x{22DC}" => "\x{22DD}", # EQUAL TO OR LESS-THAN/GREATER-THAN
2562 "\x{22DE}" => "\x{22DF}", # EQUAL TO OR PRECEDES/SUCCEEDS
2563 "\x{22E0}" => "\x{22E1}", # DOES NOT PRECEDE/SUCCEED OR EQUAL
2564 "\x{22E6}" => "\x{22E7}", # LESS-THAN/GREATER-THAN BUT NOT EQUIVALENT TO
2565 "\x{22E8}" => "\x{22E9}", # PRECEDES/SUCCEEDS BUT NOT EQUIVALENT TO
2566 "\x{22F2}" => "\x{22FA}", # ELEMENT OF/CONTAINS WITH LONG HORIZONTAL STROKE
2567 "\x{22F3}" => "\x{22FB}", # ELEMENT OF/CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
2568 "\x{22F4}" => "\x{22FC}", # SMALL ELEMENT OF/CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
2569 "\x{22F6}" => "\x{22FD}", # ELEMENT OF/CONTAINS WITH OVERBAR
2570 "\x{22F7}" => "\x{22FE}", # SMALL ELEMENT OF/CONTAINS WITH OVERBAR
2571 "\x{2308}" => "\x{2309}", # LEFT/RIGHT CEILING
2572 "\x{230A}" => "\x{230B}", # LEFT/RIGHT FLOOR
2573 "\x{2326}" => "\x{232B}", # ERASE TO THE RIGHT/LEFT
2574 "\x{2329}" => "\x{232A}", # LEFT/RIGHT-POINTING ANGLE BRACKET
2575 "\x{2348}" => "\x{2347}", # APL FUNCTIONAL SYMBOL QUAD RIGHT/LEFTWARDS ARROW
2576 "\x{23E9}" => "\x{23EA}", # BLACK RIGHT/LEFT-POINTING DOUBLE TRIANGLE
2577 "\x{23ED}" => "\x{23EE}", # BLACK RIGHT/LEFT-POINTING DOUBLE TRIANGLE WITH VERTICAL BAR
2578 "\x{261B}" => "\x{261A}", # BLACK RIGHT/LEFT POINTING INDEX
2579 "\x{261E}" => "\x{261C}", # WHITE RIGHT/LEFT POINTING INDEX
2580 "\x{269E}" => "\x{269F}", # THREE LINES CONVERGING RIGHT/LEFT
2581 "\x{2768}" => "\x{2769}", # MEDIUM LEFT/RIGHT PARENTHESIS ORNAMENT
2582 "\x{276A}" => "\x{276B}", # MEDIUM FLATTENED LEFT/RIGHT PARENTHESIS ORNAMENT
2583 "\x{276C}" => "\x{276D}", # MEDIUM LEFT/RIGHT-POINTING ANGLE BRACKET ORNAMENT
2584 "\x{276E}" => "\x{276F}", # HEAVY LEFT/RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT
2585 "\x{2770}" => "\x{2771}", # HEAVY LEFT/RIGHT-POINTING ANGLE BRACKET ORNAMENT
2586 "\x{2772}" => "\x{2773}", # LIGHT LEFT/RIGHT TORTOISE SHELL BRACKET ORNAMENT
2587 "\x{2774}" => "\x{2775}", # MEDIUM LEFT/RIGHT CURLY BRACKET ORNAMENT
2588 "\x{27C3}" => "\x{27C4}", # OPEN SUBSET/SUPERSET
2589 "\x{27C5}" => "\x{27C6}", # LEFT/RIGHT S-SHAPED BAG DELIMITER
2590 "\x{27C8}" => "\x{27C9}", # REVERSE SOLIDUS PRECEDING SUBSET, SUPERSET PRECEDING SOLIDUS
2591 "\x{27DE}" => "\x{27DD}", # LONG LEFT/RIGHT TACK
2592 "\x{27E6}" => "\x{27E7}", # MATHEMATICAL LEFT/RIGHT WHITE SQUARE BRACKET
2593 "\x{27E8}" => "\x{27E9}", # MATHEMATICAL LEFT/RIGHT ANGLE BRACKET
2594 "\x{27EA}" => "\x{27EB}", # MATHEMATICAL LEFT/RIGHT DOUBLE ANGLE BRACKET
2595 "\x{27EC}" => "\x{27ED}", # MATHEMATICAL LEFT/RIGHT WHITE TORTOISE SHELL BRACKET
2596 "\x{27EE}" => "\x{27EF}", # MATHEMATICAL LEFT/RIGHT FLATTENED PARENTHESIS
2597 "\x{27F4}" => "\x{2B32}", # RIGHT/LEFT ARROW WITH CIRCLED PLUS
2598 "\x{27F6}" => "\x{27F5}", # LONG RIGHT/LEFTWARDS ARROW
2599 "\x{27F9}" => "\x{27F8}", # LONG RIGHT/LEFTWARDS DOUBLE ARROW
2600 "\x{27FC}" => "\x{27FB}", # LONG RIGHT/LEFTWARDS ARROW FROM BAR
2601 "\x{27FE}" => "\x{27FD}", # LONG RIGHT/LEFTWARDS DOUBLE ARROW FROM BAR
2602 "\x{27FF}" => "\x{2B33}", # LONG RIGHT/LEFTWARDS SQUIGGLE ARROW
2603 "\x{2900}" => "\x{2B34}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
2604 "\x{2901}" => "\x{2B35}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
2605 "\x{2903}" => "\x{2902}", # RIGHT/LEFTWARDS DOUBLE ARROW WITH VERTICAL STROKE
2606 "\x{2905}" => "\x{2B36}", # RIGHT/LEFTWARDS TWO-HEADED ARROW FROM BAR
2607 "\x{2907}" => "\x{2906}", # RIGHT/LEFTWARDS DOUBLE ARROW FROM BAR
2608 "\x{290D}" => "\x{290C}", # RIGHT/LEFTWARDS DOUBLE DASH ARROW
2609 "\x{290F}" => "\x{290E}", # RIGHT/LEFTWARDS TRIPLE DASH ARROW
2610 "\x{2910}" => "\x{2B37}", # RIGHT/LEFTWARDS TWO-HEADED TRIPLE DASH ARROW
2611 "\x{2911}" => "\x{2B38}", # RIGHT/LEFTWARDS ARROW WITH DOTTED STEM
2612 "\x{2914}" => "\x{2B39}", # RIGHT/LEFTWARDS ARROW WITH TAIL WITH VERTICAL STROKE
2613 "\x{2915}" => "\x{2B3A}", # RIGHT/LEFTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
2614 "\x{2916}" => "\x{2B3B}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TAIL
2615 "\x{2917}" => "\x{2B3C}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE
2616 "\x{2918}" => "\x{2B3D}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
2617 "\x{291A}" => "\x{2919}", # RIGHT/LEFTWARDS ARROW-TAIL
2618 "\x{291C}" => "\x{291B}", # RIGHT/LEFTWARDS DOUBLE ARROW-TAIL
2619 "\x{291E}" => "\x{291D}", # RIGHT/LEFTWARDS ARROW TO BLACK DIAMOND
2620 "\x{2920}" => "\x{291F}", # RIGHT/LEFTWARDS ARROW FROM BAR TO BLACK DIAMOND
2621 "\x{2933}" => "\x{2B3F}", # WAVE ARROW POINTING DIRECTLY RIGHT/LEFT
2622 "\x{2937}" => "\x{2936}", # ARROW POINTING DOWNWARDS THEN CURVING RIGHT/LEFTWARDS
2623 "\x{2945}" => "\x{2946}", # RIGHT/LEFTWARDS ARROW WITH PLUS BELOW
2624 "\x{2947}" => "\x{2B3E}", # RIGHT/LEFTWARDS ARROW THROUGH X
2625 "\x{2953}" => "\x{2952}", # RIGHT/LEFTWARDS HARPOON WITH BARB UP TO BAR
2626 "\x{2957}" => "\x{2956}", # RIGHT/LEFTWARDS HARPOON WITH BARB DOWN TO BAR
2627 "\x{295B}" => "\x{295A}", # RIGHT/LEFTWARDS HARPOON WITH BARB UP FROM BAR
2628 "\x{295F}" => "\x{295E}", # RIGHT/LEFTWARDS HARPOON WITH BARB DOWN FROM BAR
2629 "\x{2964}" => "\x{2962}", # RIGHT/LEFTWARDS HARPOON WITH BARB UP ABOVE RIGHT/LEFTWARDS HARPOON WITH BARB DOWN
2630 "\x{296C}" => "\x{296A}", # RIGHT/LEFTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
2631 "\x{296D}" => "\x{296B}", # RIGHT/LEFTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
2632 "\x{2971}" => "\x{2B40}", # EQUALS SIGN ABOVE RIGHT/LEFTWARDS ARROW
2633 "\x{2972}" => "\x{2B41}", # TILDE OPERATOR ABOVE RIGHTWARDS ARROW, REVERSE TILDE OPERATOR ABOVE LEFTWARDS ARROW
2634 "\x{2974}" => "\x{2B4B}", # RIGHTWARDS ARROW ABOVE TILDE OPERATOR, LEFTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
2635 "\x{2975}" => "\x{2B42}", # RIGHTWARDS ARROW ABOVE ALMOST EQUAL TO, LEFTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO
2636 "\x{2979}" => "\x{297B}", # SUBSET/SUPERSET ABOVE RIGHT/LEFTWARDS ARROW
2637 "\x{2983}" => "\x{2984}", # LEFT/RIGHT WHITE CURLY BRACKET
2638 "\x{2985}" => "\x{2986}", # LEFT/RIGHT WHITE PARENTHESIS
2639 "\x{2987}" => "\x{2988}", # Z NOTATION LEFT/RIGHT IMAGE BRACKET
2640 "\x{2989}" => "\x{298A}", # Z NOTATION LEFT/RIGHT BINDING BRACKET
2641 "\x{298B}" => "\x{298C}", # LEFT/RIGHT SQUARE BRACKET WITH UNDERBAR
2642 "\x{298D}" => "\x{2990}", # LEFT/RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER
2643 "\x{298F}" => "\x{298E}", # LEFT/RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
2644 "\x{2991}" => "\x{2992}", # LEFT/RIGHT ANGLE BRACKET WITH DOT
2645 "\x{2993}" => "\x{2994}", # LEFT/RIGHT ARC LESS-THAN/GREATER-THAN BRACKET
2646 "\x{2995}" => "\x{2996}", # DOUBLE LEFT/RIGHT ARC GREATER-THAN/LESS-THAN BRACKET
2647 "\x{2997}" => "\x{2998}", # LEFT/RIGHT BLACK TORTOISE SHELL BRACKET
2648 "\x{29A8}" => "\x{29A9}", # MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND RIGHT/LEFT
2649 "\x{29AA}" => "\x{29AB}", # MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND RIGHT/LEFT
2650 "\x{29B3}" => "\x{29B4}", # EMPTY SET WITH RIGHT/LEFT ARROW ABOVE
2651 "\x{29C0}" => "\x{29C1}", # CIRCLED LESS-THAN/GREATER-THAN
2652 "\x{29D8}" => "\x{29D9}", # LEFT/RIGHT WIGGLY FENCE
2653 "\x{29DA}" => "\x{29DB}", # LEFT/RIGHT DOUBLE WIGGLY FENCE
2654 "\x{29FC}" => "\x{29FD}", # LEFT/RIGHT-POINTING CURVED ANGLE BRACKET
2655 "\x{2A79}" => "\x{2A7A}", # LESS-THAN/GREATER-THAN WITH CIRCLE INSIDE
2656 "\x{2A7B}" => "\x{2A7C}", # LESS-THAN/GREATER-THAN WITH QUESTION MARK ABOVE
2657 "\x{2A7D}" => "\x{2A7E}", # LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO
2658 "\x{2A7F}" => "\x{2A80}", # LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
2659 "\x{2A81}" => "\x{2A82}", # LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
2660 "\x{2A83}" => "\x{2A84}", # LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE RIGHT/LEFT
2661 "\x{2A85}" => "\x{2A86}", # LESS-THAN/GREATER-THAN OR APPR::XOXIMATE
2662 "\x{2A87}" => "\x{2A88}", # LESS-THAN/GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
2663 "\x{2A89}" => "\x{2A8A}", # LESS-THAN/GREATER-THAN AND NOT APPR::XOXIMATE
2664 "\x{2A8D}" => "\x{2A8E}", # LESS-THAN/GREATER-THAN ABOVE SIMILAR OR EQUAL
2665 "\x{2A95}" => "\x{2A96}", # SLANTED EQUAL TO OR LESS-THAN/GREATER-THAN
2666 "\x{2A97}" => "\x{2A98}", # SLANTED EQUAL TO OR LESS-THAN/GREATER-THAN WITH DOT INSIDE
2667 "\x{2A99}" => "\x{2A9A}", # DOUBLE-LINE EQUAL TO OR LESS-THAN/GREATER-THAN
2668 "\x{2A9B}" => "\x{2A9C}", # DOUBLE-LINE SLANTED EQUAL TO OR LESS-THAN/ GREATER-THAN
2669 "\x{2A9D}" => "\x{2A9E}", # SIMILAR OR LESS-THAN/GREATER-THAN
2670 "\x{2A9F}" => "\x{2AA0}", # SIMILAR ABOVE LESS-THAN/GREATER-THAN ABOVE EQUALS SIGN
2671 "\x{2AA1}" => "\x{2AA2}", # DOUBLE NESTED LESS-THAN/GREATER-THAN
2672 "\x{2AA6}" => "\x{2AA7}", # LESS-THAN/GREATER-THAN CLOSED BY CURVE
2673 "\x{2AA8}" => "\x{2AA9}", # LESS-THAN/GREATER-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
2674 "\x{2AAA}" => "\x{2AAB}", # SMALLER THAN/LARGER THAN
2675 "\x{2AAC}" => "\x{2AAD}", # SMALLER THAN/LARGER THAN OR EQUAL TO
2676 "\x{2AAF}" => "\x{2AB0}", # PRECEDES/SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
2677 "\x{2AB1}" => "\x{2AB2}", # PRECEDES/SUCCEEDS ABOVE SINGLE-LINE NOT EQUAL TO
2678 "\x{2AB3}" => "\x{2AB4}", # PRECEDES/SUCCEEDS ABOVE EQUALS SIGN
2679 "\x{2AB5}" => "\x{2AB6}", # PRECEDES/SUCCEEDS ABOVE NOT EQUAL TO
2680 "\x{2AB7}" => "\x{2AB8}", # PRECEDES/SUCCEEDS ABOVE ALMOST EQUAL TO
2681 "\x{2AB9}" => "\x{2ABA}", # PRECEDES/SUCCEEDS ABOVE NOT ALMOST EQUAL TO
2682 "\x{2ABB}" => "\x{2ABC}", # DOUBLE PRECEDES/SUCCEEDS
2683 "\x{2ABD}" => "\x{2ABE}", # SUBSET/SUPERSET WITH DOT
2684 "\x{2ABF}" => "\x{2AC0}", # SUBSET/SUPERSET WITH PLUS SIGN BELOW
2685 "\x{2AC1}" => "\x{2AC2}", # SUBSET/SUPERSET WITH MULTIPLICATION SIGN BELOW
2686 "\x{2AC3}" => "\x{2AC4}", # SUBSET/SUPERSET OF OR EQUAL TO WITH DOT ABOVE
2687 "\x{2AC5}" => "\x{2AC6}", # SUBSET/SUPERSET OF ABOVE EQUALS SIGN
2688 "\x{2AC7}" => "\x{2AC8}", # SUBSET/SUPERSET OF ABOVE TILDE OPERATOR
2689 "\x{2AC9}" => "\x{2ACA}", # SUBSET/SUPERSET OF ABOVE ALMOST EQUAL TO
2690 "\x{2ACB}" => "\x{2ACC}", # SUBSET/SUPERSET OF ABOVE NOT EQUAL TO
2691 "\x{2ACF}" => "\x{2AD0}", # CLOSED SUBSET/SUPERSET
2692 "\x{2AD1}" => "\x{2AD2}", # CLOSED SUBSET/SUPERSET OR EQUAL TO
2693 "\x{2AD5}" => "\x{2AD6}", # SUBSET/SUPERSET ABOVE SUBSET/SUPERSET
2694 "\x{2AE5}" => "\x{22AB}", # DOUBLE VERTICAL BAR DOUBLE LEFT/RIGHT TURNSTILE
2695 "\x{2AF7}" => "\x{2AF8}", # TRIPLE NESTED LESS-THAN/GREATER-THAN
2696 "\x{2AF9}" => "\x{2AFA}", # DOUBLE-LINE SLANTED LESS-THAN/GREATER-THAN OR EQUAL TO
2697 "\x{2B46}" => "\x{2B45}", # RIGHT/LEFTWARDS QUADRUPLE ARROW
2698 "\x{2B47}" => "\x{2B49}", # REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW, TILDE OPERATOR ABOVE LEFTWARDS ARROW
2699 "\x{2B48}" => "\x{2B4A}", # RIGHTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO, LEFTWARDS ARROW ABOVE ALMOST EQUAL TO
2700 "\x{2B4C}" => "\x{2973}", # RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR, LEFTWARDS ARROW ABOVE TILDE OPERATOR
2701 "\x{2B62}" => "\x{2B60}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW
2702 "\x{2B6C}" => "\x{2B6A}", # RIGHT/LEFTWARDS TRIANGLE-HEADED DASHED ARROW
2703 "\x{2B72}" => "\x{2B70}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW TO BAR
2704 "\x{2B7C}" => "\x{2B7A}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH DOUBLE VERTICAL STROKE
2705 "\x{2B86}" => "\x{2B84}", # RIGHT/LEFTWARDS TRIANGLE-HEADED PAIRED ARROWS
2706 "\x{2B8A}" => "\x{2B88}", # RIGHT/LEFTWARDS BLACK CIRCLED WHITE ARROW
2707 "\x{2B95}" => "\x{2B05}", # RIGHT/LEFTWARDS BLACK ARROW
2708 "\x{2B9A}" => "\x{2B98}", # THREE-D TOP-LIGHTED RIGHT/LEFTWARDS EQUILATERAL ARROWHEAD
2709 "\x{2B9E}" => "\x{2B9C}", # BLACK RIGHT/LEFTWARDS EQUILATERAL ARROWHEAD
2710 "\x{2BA1}" => "\x{2BA0}", # DOWNWARDS TRIANGLE-HEADED ARROW WITH LONG TIP RIGHT/LEFTWARDS
2711 "\x{2BA3}" => "\x{2BA2}", # UPWARDS TRIANGLE-HEADED ARROW WITH LONG TIP RIGHT/LEFTWARDS
2712 "\x{2BA9}" => "\x{2BA8}", # BLACK CURVED DOWNWARDS AND RIGHT/LEFTWARDS ARROW
2713 "\x{2BAB}" => "\x{2BAA}", # BLACK CURVED UPWARDS AND RIGHT/LEFTWARDS ARROW
2714 "\x{2BB1}" => "\x{2BB0}", # RIBBON ARROW DOWN RIGHT/LEFT
2715 "\x{2BB3}" => "\x{2BB2}", # RIBBON ARROW UP RIGHT/LEFT
2716 "\x{2BEE}" => "\x{2BEC}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS
2717 "\x{2E02}" => "\x{2E03}", # LEFT/RIGHT SUBSTITUTION BRACKET
2718 "\x{2E03}" => "\x{2E02}", # RIGHT/LEFT SUBSTITUTION BRACKET
2719 "\x{2E04}" => "\x{2E05}", # LEFT/RIGHT DOTTED SUBSTITUTION BRACKET
2720 "\x{2E05}" => "\x{2E04}", # RIGHT/LEFT DOTTED SUBSTITUTION BRACKET
2721 "\x{2E09}" => "\x{2E0A}", # LEFT/RIGHT TRANSPOSITION BRACKET
2722 "\x{2E0A}" => "\x{2E09}", # RIGHT/LEFT TRANSPOSITION BRACKET
2723 "\x{2E0C}" => "\x{2E0D}", # LEFT/RIGHT RAISED OMISSION BRACKET
2724 "\x{2E0D}" => "\x{2E0C}", # RIGHT/LEFT RAISED OMISSION BRACKET
2725 "\x{2E11}" => "\x{2E10}", # REVERSED FORKED PARAGRAPHOS, FORKED PARAGRAPHOS
2726 "\x{2E1C}" => "\x{2E1D}", # LEFT/RIGHT LOW PARAPHRASE BRACKET
2727 "\x{2E1D}" => "\x{2E1C}", # RIGHT/LEFT LOW PARAPHRASE BRACKET
2728 "\x{2E20}" => "\x{2E21}", # LEFT/RIGHT VERTICAL BAR WITH QUILL
2729 "\x{2E21}" => "\x{2E20}", # RIGHT/LEFT VERTICAL BAR WITH QUILL
2730 "\x{2E22}" => "\x{2E23}", # TOP LEFT/RIGHT HALF BRACKET
2731 "\x{2E24}" => "\x{2E25}", # BOTTOM LEFT/RIGHT HALF BRACKET
2732 "\x{2E26}" => "\x{2E27}", # LEFT/RIGHT SIDEWAYS U BRACKET
2733 "\x{2E28}" => "\x{2E29}", # LEFT/RIGHT DOUBLE PARENTHESIS
2734 "\x{2E36}" => "\x{2E37}", # DAGGER WITH LEFT/RIGHT GUARD
2735 "\x{2E42}" => "\x{201E}", # DOUBLE LOW-REVERSED-9 QUOTATION MARK, DOUBLE LOW-9 QUOTATION MARK
2736 "\x{2E55}" => "\x{2E56}", # LEFT/RIGHT SQUARE BRACKET WITH STROKE
2737 "\x{2E57}" => "\x{2E58}", # LEFT/RIGHT SQUARE BRACKET WITH DOUBLE STROKE
2738 "\x{2E59}" => "\x{2E5A}", # TOP HALF LEFT/RIGHT PARENTHESIS
2739 "\x{2E5B}" => "\x{2E5C}", # BOTTOM HALF LEFT/RIGHT PARENTHESIS
2740 "\x{3008}" => "\x{3009}", # LEFT/RIGHT ANGLE BRACKET
2741 "\x{300A}" => "\x{300B}", # LEFT/RIGHT DOUBLE ANGLE BRACKET
2742 "\x{300C}" => "\x{300D}", # LEFT/RIGHT CORNER BRACKET
2743 "\x{300E}" => "\x{300F}", # LEFT/RIGHT WHITE CORNER BRACKET
2744 "\x{3010}" => "\x{3011}", # LEFT/RIGHT BLACK LENTICULAR BRACKET
2745 "\x{3014}" => "\x{3015}", # LEFT/RIGHT TORTOISE SHELL BRACKET
2746 "\x{3016}" => "\x{3017}", # LEFT/RIGHT WHITE LENTICULAR BRACKET
2747 "\x{3018}" => "\x{3019}", # LEFT/RIGHT WHITE TORTOISE SHELL BRACKET
2748 "\x{301A}" => "\x{301B}", # LEFT/RIGHT WHITE SQUARE BRACKET
2749 "\x{301D}" => "\x{301E}", # REVERSED DOUBLE PRIME QUOTATION MARK, DOUBLE PRIME QUOTATION MARK
2750 "\x{A9C1}" => "\x{A9C2}", # JAVANESE LEFT/RIGHT RERENGGAN
2751 "\x{FD3E}" => "\x{FD3F}", # ORNATE LEFT/RIGHT PARENTHESIS
2752 "\x{FE59}" => "\x{FE5A}", # SMALL LEFT/RIGHT PARENTHESIS
2753 "\x{FE5B}" => "\x{FE5C}", # SMALL LEFT/RIGHT CURLY BRACKET
2754 "\x{FE5D}" => "\x{FE5E}", # SMALL LEFT/RIGHT TORTOISE SHELL BRACKET
2755 "\x{FE64}" => "\x{FE65}", # SMALL LESS-THAN/GREATER-THAN SIGN
2756 "\x{FF08}" => "\x{FF09}", # FULLWIDTH LEFT/RIGHT PARENTHESIS
2757 "\x{FF1C}" => "\x{FF1E}", # FULLWIDTH LESS-THAN/GREATER-THAN SIGN
2758 "\x{FF3B}" => "\x{FF3D}", # FULLWIDTH LEFT/RIGHT SQUARE BRACKET
2759 "\x{FF5B}" => "\x{FF5D}", # FULLWIDTH LEFT/RIGHT CURLY BRACKET
2760 "\x{FF5F}" => "\x{FF60}", # FULLWIDTH LEFT/RIGHT WHITE PARENTHESIS
2761 "\x{FF62}" => "\x{FF63}", # HALFWIDTH LEFT/RIGHT CORNER BRACKET
2762 "\x{FFEB}" => "\x{FFE9}", # HALFWIDTH RIGHT/LEFTWARDS ARROW
2763 "\x{1D103}" => "\x{1D102}", # MUSICAL SYMBOL REVERSE FINAL BARLINE, MUSICAL SYMBOL FINAL BARLINE
2764 "\x{1D106}" => "\x{1D107}", # MUSICAL SYMBOL LEFT/RIGHT REPEAT SIGN
2765 "\x{1F449}" => "\x{1F448}", # WHITE RIGHT/LEFT POINTING BACKHAND INDEX
2766 "\x{1F508}" => "\x{1F568}", # SPEAKER, RIGHT SPEAKER
2767 "\x{1F509}" => "\x{1F569}", # SPEAKER WITH ONE SOUND WAVE, RIGHT SPEAKER WITH ONE SOUND WAVE
2768 "\x{1F50A}" => "\x{1F56A}", # SPEAKER WITH THREE SOUND WAVES, RIGHT SPEAKER WITH THREE SOUND WAVES
2769 "\x{1F57B}" => "\x{1F57D}", # LEFT/RIGHT HAND TELEPHONE RECEIVER
2770 "\x{1F599}" => "\x{1F598}", # SIDEWAYS WHITE RIGHT/LEFT POINTING INDEX
2771 "\x{1F59B}" => "\x{1F59A}", # SIDEWAYS BLACK RIGHT/LEFT POINTING INDEX
2772 "\x{1F59D}" => "\x{1F59C}", # BLACK RIGHT/LEFT POINTING BACKHAND INDEX
2773 "\x{1F5E6}" => "\x{1F5E7}", # THREE RAYS LEFT/RIGHT
2774 "\x{1F802}" => "\x{1F800}", # RIGHT/LEFTWARDS ARROW WITH SMALL TRIANGLE ARROWHEAD
2775 "\x{1F806}" => "\x{1F804}", # RIGHT/LEFTWARDS ARROW WITH MEDIUM TRIANGLE ARROWHEAD
2776 "\x{1F80A}" => "\x{1F808}", # RIGHT/LEFTWARDS ARROW WITH LARGE TRIANGLE ARROWHEAD
2777 "\x{1F812}" => "\x{1F810}", # RIGHT/LEFTWARDS ARROW WITH SMALL EQUILATERAL ARROWHEAD
2778 "\x{1F816}" => "\x{1F814}", # RIGHT/LEFTWARDS ARROW WITH EQUILATERAL ARROWHEAD
2779 "\x{1F81A}" => "\x{1F818}", # HEAVY RIGHT/LEFTWARDS ARROW WITH EQUILATERAL ARROWHEAD
2780 "\x{1F81E}" => "\x{1F81C}", # HEAVY RIGHT/LEFTWARDS ARROW WITH LARGE EQUILATERAL ARROWHEAD
2781 "\x{1F822}" => "\x{1F820}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH NARROW SHAFT
2782 "\x{1F826}" => "\x{1F824}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH MEDIUM SHAFT
2783 "\x{1F82A}" => "\x{1F828}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH BOLD SHAFT
2784 "\x{1F82E}" => "\x{1F82C}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH HEAVY SHAFT
2785 "\x{1F832}" => "\x{1F830}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH VERY HEAVY SHAFT
2786 "\x{1F836}" => "\x{1F834}", # RIGHT/LEFTWARDS FINGER-POST ARROW
2787 "\x{1F83A}" => "\x{1F838}", # RIGHT/LEFTWARDS SQUARED ARROW
2788 "\x{1F83E}" => "\x{1F83C}", # RIGHT/LEFTWARDS COMPRESSED ARROW
2789 "\x{1F842}" => "\x{1F840}", # RIGHT/LEFTWARDS HEAVY COMPRESSED ARROW
2790 "\x{1F846}" => "\x{1F844}", # RIGHT/LEFTWARDS HEAVY ARROW
2791 "\x{1F852}" => "\x{1F850}", # RIGHT/LEFTWARDS SANS-SERIF ARROW
2792 "\x{1F862}" => "\x{1F860}", # WIDE-HEADED RIGHT/LEFTWARDS LIGHT BARB ARROW
2793 "\x{1F86A}" => "\x{1F868}", # WIDE-HEADED RIGHT/LEFTWARDS BARB ARROW
2794 "\x{1F872}" => "\x{1F870}", # WIDE-HEADED RIGHT/LEFTWARDS MEDIUM BARB ARROW
2795 "\x{1F87A}" => "\x{1F878}", # WIDE-HEADED RIGHT/LEFTWARDS HEAVY BARB ARROW
2796 "\x{1F882}" => "\x{1F880}", # WIDE-HEADED RIGHT/LEFTWARDS VERY HEAVY BARB ARROW
2797 "\x{1F892}" => "\x{1F890}", # RIGHT/LEFTWARDS TRIANGLE ARROWHEAD
2798 "\x{1F896}" => "\x{1F894}", # RIGHT/LEFTWARDS WHITE ARROW WITHIN TRIANGLE ARROWHEAD
2799 "\x{1F89A}" => "\x{1F898}", # RIGHT/LEFTWARDS ARROW WITH NOTCHED TAIL
2800 "\x{1F8A1}" => "\x{1F8A0}", # RIGHTWARDS BOTTOM SHADED WHITE ARROW, LEFTWARDS BOTTOM-SHADED WHITE ARROW
2801 "\x{1F8A3}" => "\x{1F8A2}", # RIGHT/LEFTWARDS TOP SHADED WHITE ARROW
2802 "\x{1F8A5}" => "\x{1F8A6}", # RIGHT/LEFTWARDS RIGHT-SHADED WHITE ARROW
2803 "\x{1F8A7}" => "\x{1F8A4}", # RIGHT/LEFTWARDS LEFT-SHADED WHITE ARROW
2804 "\x{1F8A9}" => "\x{1F8A8}", # RIGHT/LEFTWARDS BACK-TILTED SHADOWED WHITE ARROW
2805 "\x{1F8AB}" => "\x{1F8AA}", # RIGHT/LEFTWARDS FRONT-TILTED SHADOWED WHITE ARROW
2806 );
2807 }
2808  
2809 0 ▶sub decomment {
Subroutine decomment: not called CC=5 SCAR=34.0
Pod documented
2810 0 ▶ if ($] >= 5.014 && $] < 5.016) { _croak( "PPR::X::decomment() does not work under Perl 5.14" )}
Branch: 1 branch
BranchTrueFalseTotal
if ($] >= "5.014" and $] < "5.016") 0 0 0
Condition0%0/3
$] >= "5.014" and $] < "5.016"
!ll&&!rl&&r
000
MC/DC0%0/2
$] >= "5.014" and $] < "5.016"
$] >= "5.014" $] < "5.016"
Truth table0%0/3
A and B
A= $] >= "5.014"B= $] < "5.016"
ABresult
0X0
100
111
2811  
2812 0 my ($str) = @_;
2813  
2814 0 local %PPR::X::comment_len;
2815  
2816 # Locate comments...
2817 0 ▶ $str =~ m{ (?&PerlEntireDocument)
Branch: 1 branch
BranchTrueFalseTotal
$str =~ / (?&PerlEntireDocument) (?(DEFINE) (?<decomment> ( (?<! [\$\@%] ) [#] [^\n]*+ ) (?{ my $len = length $^N; my $pos = pos($_) - $len; $comment_len{$pos} = $len; }) ) (?<PerlOWS> (?: \h++ | (?&PPR_X_newline_and_heredoc) | (?&decomment) | __ (?> END | DATA ) __ \b .*+ \z )*+ ) # End of rule (?<PerlNWS> (?: \h++ | (?&PPR_X_newline_and_heredoc) | (?&decomment) | __ (?> END | DATA ) __ \b .*+ \z )++ ) # End of rule (?<PerlPod> ( ^ = [^\W\d]\w*+ .*? (?> ^ = cut \b [^\n]*+ $ | \z ) ) (?{ my $len = length $^N; my $pos = pos($_) - $len; $comment_len{$pos} = $len; }) ) # End of rule $GRAMMAR ) /msx or return 0 0 0
2818  
2819 (?(DEFINE)
2820 (?<decomment>
2821 ( (?<! [\$@%] ) [#] [^\n]*+ )
2822 (?{
2823 0 my $len = length($^N);
2824 0 my $pos = pos() - $len;
2825 0 $PPR::X::comment_len{$pos} = $len;
2826 })
2827 )
2828  
2829 (?<PerlOWS>
2830 (?:
2831 \h++
2832 |
2833 (?&PPR_X_newline_and_heredoc)
2834 |
2835 (?&decomment)
2836 |
2837 __ (?> END | DATA ) __ \b .*+ \z
2838 )*+
2839 ) # End of rule
2840  
2841 (?<PerlNWS>
2842 (?:
2843 \h++
2844 |
2845 (?&PPR_X_newline_and_heredoc)
2846 |
2847 (?&decomment)
2848 |
2849 __ (?> END | DATA ) __ \b .*+ \z
2850 )++
2851  
2852 ) # End of rule
2853  
2854 (?<PerlPod>
2855 (
2856 ^ = [^\W\d]\w*+
2857 .*?
2858 (?>
2859 ^ = cut \b [^\n]*+ $
2860 |
2861 \z
2862 )
2863 )
2864 (?{
2865 0 my $len = length($^N);
2866 0 my $pos = pos() - $len;
2867 0 $PPR::X::comment_len{$pos} = $len;
2868 })
2869 ) # End of rule
2870  
2871 $PPR::X::GRAMMAR
2872 )
2873 }xms or return;
2874  
2875 # Delete the comments found...
2876 0 for my $from_pos (_uniq(sort { $b <=> $a } keys %PPR::X::comment_len)) {
2877 0 substr($str, $from_pos, $PPR::X::comment_len{$from_pos}) =~ s/.+//g;
2878 }
2879  
2880 0 return $str;
2881 }
2882  
2883 0 ▶sub _uniq {
Subroutine _uniq: not called CC=1 SCAR=6.9
2884 0 my %seen;
2885 0 return grep {!$seen{$_}++} @_;
2886 }
2887  
2888 0 ▶sub _croak {
Subroutine _croak: not called CC=1 SCAR=6.9
2889 0 require Carp;
2890 0 Carp::croak(@_);
2891 }
2892  
2893 0 ▶sub _report {
Subroutine _report: not called CC=4 SCAR=26.1
2894 0 state $CONTEXT_WIDTH = 20;
2895 0 state $BUFFER = q{ } x $CONTEXT_WIDTH;
2896 0 state $depth = 0;
2897 0 my ($msg, $increment) = @_;
2898 0 ▶ $depth++ if $increment;
Branch: 1 branch
BranchTrueFalseTotal
if $increment 0 0 0
2899 0 my $at = pos();
2900 0 my $str = $BUFFER . $_ . $BUFFER;
2901 0 my $pre = substr($str, $at, $CONTEXT_WIDTH);
2902 0 my $post = substr($str, $at+$CONTEXT_WIDTH, $CONTEXT_WIDTH);
2903 0 tr/\n/ / for $pre, $post;
2904 7 ▶ no warnings 'utf8';
Subroutine BEGIN: called CC=1 SCAR=0.0
2905 0 warn sprintf("%05d āŽœ%*sāŽœ%-*sāŽœ %s%s\n",
2906 $at, $CONTEXT_WIDTH, $pre, $CONTEXT_WIDTH, $post, q{ } x $depth, $msg);
2907 0 ▶ $depth-- if !$increment;
Branch: 1 branch
BranchTrueFalseTotal
if not $increment 0 0 0
2908 }
2909  
2910 7 1; # Magic true value required at end of module
2911  
2912 __END__
↑ Summary PPR.pm »