PPR.pm

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