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