PPR/X.pm

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