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.001003';
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 | qq (?= (?>(?&PerlOWS)) ' ) )
1081 (?> (?= [#] ) | (?! (?>(?&PerlOWS)) => ) )
1082 (?&PPR_X_quotelike_body)
1083 |
1084 qq \b
1085 (?> (?= [#] ) | (?! (?>(?&PerlOWS)) => ) )
1086 (?&PPR_X_quotelike_body_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_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_interpolated>
1773 (?>(?&PPR_X_quotelike_body_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_interpolated>)
1776  
1777 (?<PPR_X_regex_body_interpolated>
1778 (?>(?&PPR_X_regex_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_regex_body_interpolated>)
1781  
1782 (?<PPR_X_balanced_parens_regex_interpolated>
1783 [^)(\\\n\$\@]*+
1784 (?:
1785 (?>
1786 \\.
1787 |
1788 \( (?>(?&PPR_X_balanced_parens_regex_interpolated)) \)
1789 |
1790 (?&PPR_X_newline_and_heredoc)
1791 |
1792 (?= \$ (?! [\s(|)] ) ) (?&PerlScalarAccessNoSpace)
1793 |
1794 (?= \@ (?! [\s(|)] ) ) (?&PerlArrayAccessNoSpace)
1795 |
1796 [\$\@]
1797 )
1798 [^)(\\\n\$\@]*+
1799 )*+
1800 ) # End of rule (?<PPR_X_balanced_parens_regex_interpolated>)
1801  
1802 (?<PPR_X_balanced_curlies_regex_interpolated>
1803 [^\}\{\\\n\$\@]*+
1804 (?:
1805 (?>
1806 \\.
1807 |
1808 \{ (?>(?&PPR_X_balanced_curlies_regex_interpolated)) \}
1809 |
1810 (?&PPR_X_newline_and_heredoc)
1811 |
1812 (?= \$ (?! [\s\}(|)] ) ) (?&PerlScalarAccessNoSpace)
1813 |
1814 (?= \@ (?! [\s\}(|)] ) ) (?&PerlArrayAccessNoSpace)
1815 |
1816 [\$\@]
1817 )
1818 [^\}\{\\\n\$\@]*+
1819 )*+
1820 ) # End of rule (?<PPR_X_balanced_curlies_regex_interpolated>)
1821  
1822 (?<PPR_X_balanced_squares_regex_interpolated>
1823 [^][\\\n\$\@]*+
1824 (?:
1825 (?>
1826 \\.
1827 |
1828 \[ (?>(?&PPR_X_balanced_squares_regex_interpolated)) \]
1829 |
1830 (?&PPR_X_newline_and_heredoc)
1831 |
1832 (?= \$ (?! [\s\](|)] ) ) (?&PerlScalarAccessNoSpace)
1833 |
1834 (?= \@ (?! [\s\](|)] ) ) (?&PerlArrayAccessNoSpace)
1835 |
1836 [\$\@]
1837 )
1838 [^][\\\n\$\@]*+
1839 )*+
1840 ) # End of rule (?<PPR_X_balanced_squares_regex_interpolated>)
1841  
1842 (?<PPR_X_balanced_angles_regex_interpolated>
1843 [^><\\\n\$\@]*+
1844 (?:
1845 (?>
1846 \\.
1847 |
1848 < (?>(?&PPR_X_balanced_angles_regex_interpolated)) >
1849 |
1850 (?&PPR_X_newline_and_heredoc)
1851 |
1852 (?= \$ (?! [\s>(|)] ) ) (?&PerlScalarAccessNoSpace)
1853 |
1854 (?= \@ (?! [\s>(|)] ) ) (?&PerlArrayAccessNoSpace)
1855 |
1856 [\$\@]
1857 )
1858 [^><\\\n\$\@]*+
1859 )*+
1860 ) # End of rule (?<PPR_X_balanced_angles_regex_interpolated>)
1861  
1862  
1863 (?<PPR_X_balanced_unicode_delims_regex_interpolated>
1864 (??{$PPR::X::_qld_not_special_or_sigil})*+
1865 (?:
1866 (?>
1867 \\.
1868 |
1869 (??{ $PPR::X::_qld_open })
1870 (?>(?&PPR_X_balanced_unicode_delims_regex_interpolated))
1871 (??{ $PPR::X::_qld_close })
1872 |
1873 (?&PPR_X_newline_and_heredoc)
1874 |
1875 (?= \$ (??{ $PPR::X::_qld_not_special_in_regex_var }) )
1876 (?&PerlScalarAccessNoSpace)
1877 |
1878 (?= \$ (??{ $PPR::X::_qld_not_special_in_regex_var }) )
1879 (?&PerlArrayAccessNoSpace)
1880 |
1881 [\$\@]
1882 )
1883 (??{$PPR::X::_qld_not_special_or_sigil})*+
1884 )*+
1885 ) # End of rule (?<PPR_X_balanced_unicode_delims_regex_interpolated>)
1886  
1887  
1888 (?<PPR_X_balanced_parens_interpolated>
1889 [^)(\\\n\$\@]*+
1890 (?:
1891 (?>
1892 \\.
1893 |
1894 \( (?>(?&PPR_X_balanced_parens_interpolated)) \)
1895 |
1896 (?&PPR_X_newline_and_heredoc)
1897 |
1898 (?= \$ (?! [\s\)] ) ) (?&PerlScalarAccessNoSpace)
1899 |
1900 (?= \@ (?! [\s\)] ) ) (?&PerlArrayAccessNoSpace)
1901 |
1902 [\$\@]
1903 )
1904 [^)(\\\n\$\@]*+
1905 )*+
1906 ) # End of rule (?<PPR_X_balanced_parens_interpolated>)
1907  
1908 (?<PPR_X_balanced_curlies_interpolated>
1909 [^\}\{\\\n\$\@]*+
1910 (?:
1911 (?>
1912 \\.
1913 |
1914 \{ (?>(?&PPR_X_balanced_curlies_interpolated)) \}
1915 |
1916 (?&PPR_X_newline_and_heredoc)
1917 |
1918 (?= \$ (?! [\s\}] ) ) (?&PerlScalarAccessNoSpace)
1919 |
1920 (?= \@ (?! [\s\}] ) ) (?&PerlArrayAccessNoSpace)
1921 |
1922 [\$\@]
1923 )
1924 [^\}\{\\\n\$\@]*+
1925 )*+
1926 ) # End of rule (?<PPR_X_balanced_curlies_interpolated>)
1927  
1928 (?<PPR_X_balanced_squares_interpolated>
1929 [^][\\\n\$\@]*+
1930 (?:
1931 (?>
1932 \\.
1933 |
1934 \[ (?>(?&PPR_X_balanced_squares_interpolated)) \]
1935 |
1936 (?&PPR_X_newline_and_heredoc)
1937 |
1938 (?= \$ (?! [\s\]] ) ) (?&PerlScalarAccessNoSpace)
1939 |
1940 (?= \@ (?! [\s\]] ) ) (?&PerlArrayAccessNoSpace)
1941 |
1942 [\$\@]
1943 )
1944 [^][\\\n\$\@]*+
1945 )*+
1946 ) # End of rule (?<PPR_X_balanced_squares_interpolated>)
1947  
1948 (?<PPR_X_balanced_unicode_delims_interpolated>
1949 (??{$PPR::X::_qld_not_special_or_sigil})*+
1950 (?:
1951 (?>
1952 \\.
1953 |
1954 (??{$PPR::X::_qld_open})
1955 (?>(?&PPR_X_balanced_unicode_delims_interpolated))
1956 (??{$PPR::X::_qld_close})
1957 |
1958 (?&PPR_X_newline_and_heredoc)
1959 |
1960 (?= \$ (?! \s | (??{$PPR::X::_qld_close}) ) ) (?&PerlScalarAccessNoSpace)
1961 |
1962 (?= \@ (?! \s | (??{$PPR::X::_qld_close}) ) ) (?&PerlArrayAccessNoSpace)
1963 |
1964 [\$\@]
1965 )
1966 (??{$PPR::X::_qld_not_special_or_sigil})*+
1967 )*+
1968 ) # End of rule (?<PPR_X_balanced_unicode_delims_interpolated>)
1969  
1970 (?<PPR_X_balanced_angles_interpolated>
1971 [^><\\\n\$\@]*+
1972 (?:
1973 (?>
1974 \\.
1975 |
1976 < (?>(?&PPR_X_balanced_angles_interpolated)) >
1977 |
1978 (?&PPR_X_newline_and_heredoc)
1979 |
1980 (?= \$ (?! [\s>] ) ) (?&PerlScalarAccessNoSpace)
1981 |
1982 (?= \@ (?! [\s>] ) ) (?&PerlArrayAccessNoSpace)
1983 |
1984 [\$\@]
1985 )
1986 [^><\\\n\$\@]*+
1987 )*+
1988 ) # End of rule (?<PPR_X_balanced_angles_interpolated>)
1989  
1990 (?<PPR_X_regex_body_interpolated_unclosed>
1991 # Start by working out where it actually ends (ignoring interpolations)...
1992 (?=
1993 (?>
1994 [#]
1995 [^#\\\n\$\@]*+
1996 (?:
1997 (?>
1998 \\.
1999 |
2000 (?&PPR_X_newline_and_heredoc)
2001 |
2002 (?= \$ (?! [\s#|()] ) ) (?&PerlScalarAccessNoSpace)
2003 |
2004 (?= \@ (?! [\s#|()] ) ) (?&PerlArrayAccessNoSpace)
2005 |
2006 [\$\@]
2007 )
2008 [^#\\\n\$\@]*+
2009 )*+
2010 (?= [#] )
2011 |
2012 (?>(?&PerlOWS))
2013 (?>
2014 \{ (?>(?&PPR_X_balanced_curlies_regex_interpolated)) (?= \} )
2015 |
2016 \[ (?>(?&PPR_X_balanced_squares_regex_interpolated)) (?= \] )
2017 |
2018 \( (?>(?&PPR_X_balanced_parens_regex_interpolated)) (?= \) )
2019 |
2020 < (?>(?&PPR_X_balanced_angles_regex_interpolated)) (?= > )
2021 |
2022 (\X) (??{ exists $PPR::X::_QLD_CLOSE_FOR{$^N} ? '' : '(?!)' })
2023 (?{ local $PPR::X::_qld_open = $^N;
2024 local $PPR::X::_qld_close = $PPR::X::_QLD_CLOSE_FOR{$PPR::X::_qld_open};
2025 local $PPR::X::_qld_not_special
2026 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n]";
2027 local $PPR::X::_qld_not_special_or_sigil
2028 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n\\\$\\\@]";
2029 local $PPR::X::_qld_not_special_in_regex_var
2030 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\s(|)]";
2031 })
2032 (?>(?&PPR_X_balanced_unicode_delims_regex_interpolated))
2033 (?= (??{$PPR::X::_qld_close}) )
2034 |
2035 '
2036 [^'\n]*+
2037 (?:
2038 (?> (?&PPR_X_newline_and_heredoc))
2039 [^'\n]*+
2040 )*+
2041 (?= ' )
2042 |
2043 \\
2044 [^\\\n\$\@]*+
2045 (?:
2046 (?>
2047 (?&PPR_X_newline_and_heredoc)
2048 |
2049 (?= \$ (?! [\s\\|()] ) ) (?&PerlScalarAccessNoSpace)
2050 |
2051 (?= \@ (?! [\s\\|()] ) ) (?&PerlArrayAccessNoSpace)
2052 |
2053 [\$\@]
2054 )
2055 [^\\\n\$\@]*+
2056 )*+
2057 (?= \\ )
2058 |
2059 /
2060 [^\\/\n\$\@]*+
2061 (?:
2062 (?>
2063 \\.
2064 |
2065 (?&PPR_X_newline_and_heredoc)
2066 |
2067 (?= \$ (?! [\s/|()] ) ) (?&PerlScalarAccessNoSpace)
2068 |
2069 (?= \@ (?! [\s/|()] ) ) (?&PerlArrayAccessNoSpace)
2070 |
2071 [\$\@]
2072 )
2073 [^\\/\n\$\@]*+
2074 )*+
2075 (?= / )
2076 |
2077 -
2078 (?:
2079 \\.
2080 |
2081 (?&PPR_X_newline_and_heredoc)
2082 |
2083 (?:
2084 (?= \$ (?! [\s|()-] ) ) (?&PerlScalarAccessNoSpaceNoArrow)
2085 |
2086 (?= \@ (?! [\s|()-] ) ) (?&PerlArrayAccessNoSpaceNoArrow)
2087 |
2088 [^-]
2089 )
2090 )*+
2091 (?= - )
2092 |
2093 (?<PPR_X_qldel> \S )
2094 (?:
2095 \\.
2096 |
2097 (?&PPR_X_newline_and_heredoc)
2098 |
2099 (?! \g{PPR_X_qldel} )
2100 (?:
2101 (?= \$ (?! \g{PPR_X_qldel} | [\s|()] ) ) (?&PerlScalarAccessNoSpace)
2102 |
2103 (?= \@ (?! \g{PPR_X_qldel} | [\s|()] ) ) (?&PerlArrayAccessNoSpace)
2104 |
2105 .
2106 )
2107 )*+
2108 (?= \g{PPR_X_qldel} )
2109 )
2110 )
2111 )
2112  
2113 (?&PPR_X_regex_body_unclosed)
2114 ) # End of rule (?<PPR_X_regex_body_interpolated_unclosed>)
2115  
2116 (?<PPR_X_quotelike_body_interpolated_unclosed>
2117 # Start by working out where it actually ends (ignoring interpolations)...
2118 (?=
2119 (?>
2120 [#]
2121 [^#\\\n\$\@]*+
2122 (?:
2123 (?>
2124 \\.
2125 |
2126 (?&PPR_X_newline_and_heredoc)
2127 |
2128 (?= \$ (?! [\s#] ) ) (?&PerlScalarAccessNoSpace)
2129 |
2130 (?= \@ (?! [\s#] ) ) (?&PerlArrayAccessNoSpace)
2131 |
2132 [\$\@]
2133 )
2134 [^#\\\n\$\@]*+
2135 )*+
2136 (?= [#] )
2137 |
2138 (?>(?&PerlOWS))
2139 (?>
2140 \{ (?>(?&PPR_X_balanced_curlies_interpolated)) (?= \} )
2141 |
2142 \[ (?>(?&PPR_X_balanced_squares_interpolated)) (?= \] )
2143 |
2144 \( (?>(?&PPR_X_balanced_parens_interpolated)) (?= \) )
2145 |
2146 < (?>(?&PPR_X_balanced_angles_interpolated)) (?= > )
2147 |
2148 (\X) (??{ exists $PPR::X::_QLD_CLOSE_FOR{$^N} ? '' : '(?!)' })
2149 (?{ local $PPR::X::_qld_open = $^N;
2150 local $PPR::X::_qld_close = $PPR::X::_QLD_CLOSE_FOR{$PPR::X::_qld_open};
2151 local $PPR::X::_qld_not_special
2152 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n]";
2153 local $PPR::X::_qld_not_special_or_sigil
2154 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\\\\\n\\\$\\\@]";
2155 local $PPR::X::_qld_not_special_in_regex_var
2156 = "[^$PPR::X::_qld_open$PPR::X::_qld_close\\s(|)]";
2157 })
2158 (?>(?&PPR_X_balanced_unicode_delims_interpolated))
2159 (?= (??{$PPR::X::_qld_close}) )
2160 |
2161 '
2162 [^'\n]*+
2163 (?:
2164 (?> (?&PPR_X_newline_and_heredoc))
2165 [^'\n]*+
2166 )*+
2167 (?= ' )
2168 |
2169 \\
2170 [^\\\n\$\@]*+
2171 (?:
2172 (?>
2173 (?&PPR_X_newline_and_heredoc)
2174 |
2175 (?= \$ (?! [\s\\] ) ) (?&PerlScalarAccessNoSpace)
2176 |
2177 (?= \@ (?! [\s\\] ) ) (?&PerlArrayAccessNoSpace)
2178 |
2179 [\$\@]
2180 )
2181 [^\\\n\$\@]*+
2182 )*+
2183 (?= \\ )
2184 |
2185 /
2186 [^\\/\n\$\@]*+
2187 (?:
2188 (?>
2189 \\.
2190 |
2191 (?&PPR_X_newline_and_heredoc)
2192 |
2193 (?= \$ (?! [\s/] ) ) (?&PerlScalarAccessNoSpace)
2194 |
2195 (?= \@ (?! [\s/] ) ) (?&PerlArrayAccessNoSpace)
2196 |
2197 [\$\@]
2198 )
2199 [^\\/\n\$\@]*+
2200 )*+
2201 (?= / )
2202 |
2203 -
2204 (?:
2205 \\.
2206 |
2207 (?&PPR_X_newline_and_heredoc)
2208 |
2209 (?:
2210 (?= \$ (?! [\s-] ) ) (?&PerlScalarAccessNoSpaceNoArrow)
2211 |
2212 (?= \@ (?! [\s-] ) ) (?&PerlArrayAccessNoSpaceNoArrow)
2213 |
2214 [^-]
2215 )
2216 )*+
2217 (?= - )
2218 |
2219 (?<PPR_X_qldel> \S )
2220 (?:
2221 \\.
2222 |
2223 (?&PPR_X_newline_and_heredoc)
2224 |
2225 (?! \g{PPR_X_qldel} )
2226 (?:
2227 (?= \$ (?! \g{PPR_X_qldel} | \s ) ) (?&PerlScalarAccessNoSpace)
2228 |
2229 (?= \@ (?! \g{PPR_X_qldel} | \s ) ) (?&PerlArrayAccessNoSpace)
2230 |
2231 .
2232 )
2233 )*+
2234 (?= \g{PPR_X_qldel} )
2235 )
2236 )
2237 )
2238  
2239 (?&PPR_X_quotelike_body_unclosed)
2240 ) # End of rule (?<PPR_X_quotelike_body_interpolated_unclosed>)
2241  
2242 (?<PPR_X_quotelike_s_e_check>
2243 (??{ local $PPR::X::_quotelike_s_end = -1; '' })
2244 (?:
2245 (?=
2246 (?&PPR_X_quotelike_body_interpolated)
2247 (??{ $PPR::X::_quotelike_s_end = +pos(); '' })
2248 [msixpodualgcrn]*+ e [msixpodualgcern]*+
2249 )
2250 (?=
2251 \S # Skip the left delimiter
2252 (?(?{ $PPR::X::_quotelike_s_end >= 0 })
2253 (?>
2254 (??{ +pos() && +pos() < $PPR::X::_quotelike_s_end ? '' : '(?!)' })
2255 (?>
2256 (?&PerlExpression)
2257 |
2258 \\?+ .
2259 )
2260 )*+
2261 )
2262 )
2263 )?+
2264 ) # End of rule (?<PPR_X_quotelike_s_e_check>)
2265  
2266 (?<PPR_X_quotelike_s_e_check_uninterpolated>
2267 (??{ local $PPR::X::_quotelike_s_end = -1; '' })
2268 (?:
2269 (?=
2270 (?&PPR_X_quotelike_body)
2271 (??{ $PPR::X::_quotelike_s_end = +pos(); '' })
2272 [msixpodualgcrn]*+ e [msixpodualgcern]*+
2273 )
2274 (?=
2275 \S # Skip the left delimiter
2276 (?(?{ $PPR::X::_quotelike_s_end >= 0 })
2277 (?>
2278 (??{ +pos() && +pos() < $PPR::X::_quotelike_s_end ? '' : '(?!)' })
2279 (?>
2280 (?&PerlExpression)
2281 |
2282 \\?+ .
2283 )
2284 )*+
2285 )
2286 )
2287 )?+
2288 ) # End of rule (?<PPR_X_quotelike_s_e_check_uninterpolated>)
2289  
2290 (?<PPR_X_filetest_name> [ABCMORSTWXbcdefgkloprstuwxz] )
2291  
2292 (?<PPR_X_digit_seq> \d++ (?: _?+ \d++ )*+ )
2293 (?<PPR_X_x_digit_seq> [\da-fA-F]++ (?: _?+ [\da-fA-F]++ )*+ )
2294 (?<PPR_X_o_digit_seq> [0-7]++ (?: _?+ [0-7]++ )*+ )
2295 (?<PPR_X_b_digit_seq> [0-1]++ (?: _?+ [0-1]++ )*+ )
2296  
2297 (?<PPR_X_newline_and_heredoc>
2298 \n (??{ ($PPR::X::_heredoc_origin // q{}) eq ($_//q{}) ? ($PPR::X::_heredoc_skip{+pos()} // q{}) : q{} })
2299 ) # End of rule (?<PPR_X_newline_and_heredoc>)
2300 )
2301 # END OF GRAMMAR
2302 6 }xms;
2303  
2304  
2305 BEGIN {
2306 6 ▶ %PPR::X::_QLD_CLOSE_FOR = (
Subroutine BEGIN: called CC=1 SCAR=0.0
2307 # "\x{0028}" => "\x{0029}", # LEFT/RIGHT PARENTHESIS
2308 # "\x{003C}" => "\x{003E}", # LESS-THAN/GREATER-THAN SIGN
2309 # "\x{005B}" => "\x{005D}", # LEFT/RIGHT SQUARE BRACKET
2310 # "\x{007B}" => "\x{007D}", # LEFT/RIGHT CURLY BRACKET
2311 "\x{00AB}" => "\x{00BB}", # LEFT/RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
2312 "\x{00BB}" => "\x{00AB}", # RIGHT/LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
2313 "\x{0706}" => "\x{0707}", # SYRIAC COLON SKEWED LEFT/RIGHT
2314 "\x{0F3A}" => "\x{0F3B}", # TIBETAN MARK GUG RTAGS GYON, TIBETAN MARK GUG RTAGS GYAS
2315 "\x{0F3C}" => "\x{0F3D}", # TIBETAN MARK ANG KHANG GYON, TIBETAN MARK ANG KHANG GYAS
2316 "\x{169B}" => "\x{169C}", # OGHAM FEATHER MARK, OGHAM REVERSED FEATHER MARK
2317 "\x{2018}" => "\x{2019}", # LEFT/RIGHT SINGLE QUOTATION MARK
2318 "\x{2019}" => "\x{2018}", # RIGHT/LEFT SINGLE QUOTATION MARK
2319 "\x{201C}" => "\x{201D}", # LEFT/RIGHT DOUBLE QUOTATION MARK
2320 "\x{201D}" => "\x{201C}", # RIGHT/LEFT DOUBLE QUOTATION MARK
2321 "\x{2035}" => "\x{2032}", # REVERSED PRIME, PRIME
2322 "\x{2036}" => "\x{2033}", # REVERSED DOUBLE PRIME, DOUBLE PRIME
2323 "\x{2037}" => "\x{2034}", # REVERSED TRIPLE PRIME, TRIPLE PRIME
2324 "\x{2039}" => "\x{203A}", # SINGLE LEFT/RIGHT-POINTING ANGLE QUOTATION MARK
2325 "\x{203A}" => "\x{2039}", # SINGLE RIGHT/LEFT-POINTING ANGLE QUOTATION MARK
2326 "\x{2045}" => "\x{2046}", # LEFT/RIGHT SQUARE BRACKET WITH QUILL
2327 "\x{204D}" => "\x{204C}", # BLACK RIGHT/LEFTWARDS BULLET
2328 "\x{207D}" => "\x{207E}", # SUPERSCRIPT LEFT/RIGHT PARENTHESIS
2329 "\x{208D}" => "\x{208E}", # SUBSCRIPT LEFT/RIGHT PARENTHESIS
2330 "\x{2192}" => "\x{2190}", # RIGHT/LEFTWARDS ARROW
2331 "\x{219B}" => "\x{219A}", # RIGHT/LEFTWARDS ARROW WITH STROKE
2332 "\x{219D}" => "\x{219C}", # RIGHT/LEFTWARDS WAVE ARROW
2333 "\x{21A0}" => "\x{219E}", # RIGHT/LEFTWARDS TWO HEADED ARROW
2334 "\x{21A3}" => "\x{21A2}", # RIGHT/LEFTWARDS ARROW WITH TAIL
2335 "\x{21A6}" => "\x{21A4}", # RIGHT/LEFTWARDS ARROW FROM BAR
2336 "\x{21AA}" => "\x{21A9}", # RIGHT/LEFTWARDS ARROW WITH HOOK
2337 "\x{21AC}" => "\x{21AB}", # RIGHT/LEFTWARDS ARROW WITH LOOP
2338 "\x{21B1}" => "\x{21B0}", # UPWARDS ARROW WITH TIP RIGHT/LEFTWARDS
2339 "\x{21B3}" => "\x{21B2}", # DOWNWARDS ARROW WITH TIP RIGHT/LEFTWARDS
2340 "\x{21C0}" => "\x{21BC}", # RIGHT/LEFTWARDS HARPOON WITH BARB UPWARDS
2341 "\x{21C1}" => "\x{21BD}", # RIGHT/LEFTWARDS HARPOON WITH BARB DOWNWARDS
2342 "\x{21C9}" => "\x{21C7}", # RIGHT/LEFTWARDS PAIRED ARROWS
2343 "\x{21CF}" => "\x{21CD}", # RIGHT/LEFTWARDS DOUBLE ARROW WITH STROKE
2344 "\x{21D2}" => "\x{21D0}", # RIGHT/LEFTWARDS DOUBLE ARROW
2345 "\x{21DB}" => "\x{21DA}", # RIGHT/LEFTWARDS TRIPLE ARROW
2346 "\x{21DD}" => "\x{21DC}", # RIGHT/LEFTWARDS SQUIGGLE ARROW
2347 "\x{21E2}" => "\x{21E0}", # RIGHT/LEFTWARDS DASHED ARROW
2348 "\x{21E5}" => "\x{21E4}", # RIGHT/LEFTWARDS ARROW TO BAR
2349 "\x{21E8}" => "\x{21E6}", # RIGHT/LEFTWARDS WHITE ARROW
2350 "\x{21F4}" => "\x{2B30}", # RIGHT/LEFT ARROW WITH SMALL CIRCLE
2351 "\x{21F6}" => "\x{2B31}", # THREE RIGHT/LEFTWARDS ARROWS
2352 "\x{21F8}" => "\x{21F7}", # RIGHT/LEFTWARDS ARROW WITH VERTICAL STROKE
2353 "\x{21FB}" => "\x{21FA}", # RIGHT/LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE
2354 "\x{21FE}" => "\x{21FD}", # RIGHT/LEFTWARDS OPEN-HEADED ARROW
2355 "\x{2208}" => "\x{220B}", # ELEMENT OF, CONTAINS AS MEMBER
2356 "\x{2209}" => "\x{220C}", # NOT AN ELEMENT OF, DOES NOT CONTAIN AS MEMBER
2357 "\x{220A}" => "\x{220D}", # SMALL ELEMENT OF, SMALL CONTAINS AS MEMBER
2358 "\x{2264}" => "\x{2265}", # LESS-THAN/GREATER-THAN OR EQUAL TO
2359 "\x{2266}" => "\x{2267}", # LESS-THAN/GREATER-THAN OVER EQUAL TO
2360 "\x{2268}" => "\x{2269}", # LESS-THAN/GREATER-THAN BUT NOT EQUAL TO
2361 "\x{226A}" => "\x{226B}", # MUCH LESS-THAN/GREATER-THAN
2362 "\x{226E}" => "\x{226F}", # NOT LESS-THAN/GREATER-THAN
2363 "\x{2270}" => "\x{2271}", # NEITHER LESS-THAN/GREATER-THAN NOR EQUAL TO
2364 "\x{2272}" => "\x{2273}", # LESS-THAN/GREATER-THAN OR EQUIVALENT TO
2365 "\x{2274}" => "\x{2275}", # NEITHER LESS-THAN/GREATER-THAN NOR EQUIVALENT TO
2366 "\x{227A}" => "\x{227B}", # PRECEDES/SUCCEEDS
2367 "\x{227C}" => "\x{227D}", # PRECEDES/SUCCEEDS OR EQUAL TO
2368 "\x{227E}" => "\x{227F}", # PRECEDES/SUCCEEDS OR EQUIVALENT TO
2369 "\x{2280}" => "\x{2281}", # DOES NOT PRECEDE/SUCCEED
2370 "\x{2282}" => "\x{2283}", # SUBSET/SUPERSET OF
2371 "\x{2284}" => "\x{2285}", # NOT A SUBSET/SUPERSET OF
2372 "\x{2286}" => "\x{2287}", # SUBSET/SUPERSET OF OR EQUAL TO
2373 "\x{2288}" => "\x{2289}", # NEITHER A SUBSET/SUPERSET OF NOR EQUAL TO
2374 "\x{228A}" => "\x{228B}", # SUBSET/SUPERSET OF WITH NOT EQUAL TO
2375 "\x{22A3}" => "\x{22A2}", # LEFT/RIGHT TACK
2376 "\x{22A6}" => "\x{2ADE}", # ASSERTION, SHORT LEFT TACK
2377 "\x{22A8}" => "\x{2AE4}", # TRUE, VERTICAL BAR DOUBLE LEFT TURNSTILE
2378 "\x{22A9}" => "\x{2AE3}", # FORCES, DOUBLE VERTICAL BAR LEFT TURNSTILE
2379 "\x{22B0}" => "\x{22B1}", # PRECEDES/SUCCEEDS UNDER RELATION
2380 "\x{22D0}" => "\x{22D1}", # DOUBLE SUBSET/SUPERSET
2381 "\x{22D6}" => "\x{22D7}", # LESS-THAN/GREATER-THAN WITH DOT
2382 "\x{22D8}" => "\x{22D9}", # VERY MUCH LESS-THAN/GREATER-THAN
2383 "\x{22DC}" => "\x{22DD}", # EQUAL TO OR LESS-THAN/GREATER-THAN
2384 "\x{22DE}" => "\x{22DF}", # EQUAL TO OR PRECEDES/SUCCEEDS
2385 "\x{22E0}" => "\x{22E1}", # DOES NOT PRECEDE/SUCCEED OR EQUAL
2386 "\x{22E6}" => "\x{22E7}", # LESS-THAN/GREATER-THAN BUT NOT EQUIVALENT TO
2387 "\x{22E8}" => "\x{22E9}", # PRECEDES/SUCCEEDS BUT NOT EQUIVALENT TO
2388 "\x{22F2}" => "\x{22FA}", # ELEMENT OF/CONTAINS WITH LONG HORIZONTAL STROKE
2389 "\x{22F3}" => "\x{22FB}", # ELEMENT OF/CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
2390 "\x{22F4}" => "\x{22FC}", # SMALL ELEMENT OF/CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
2391 "\x{22F6}" => "\x{22FD}", # ELEMENT OF/CONTAINS WITH OVERBAR
2392 "\x{22F7}" => "\x{22FE}", # SMALL ELEMENT OF/CONTAINS WITH OVERBAR
2393 "\x{2308}" => "\x{2309}", # LEFT/RIGHT CEILING
2394 "\x{230A}" => "\x{230B}", # LEFT/RIGHT FLOOR
2395 "\x{2326}" => "\x{232B}", # ERASE TO THE RIGHT/LEFT
2396 "\x{2329}" => "\x{232A}", # LEFT/RIGHT-POINTING ANGLE BRACKET
2397 "\x{2348}" => "\x{2347}", # APL FUNCTIONAL SYMBOL QUAD RIGHT/LEFTWARDS ARROW
2398 "\x{23E9}" => "\x{23EA}", # BLACK RIGHT/LEFT-POINTING DOUBLE TRIANGLE
2399 "\x{23ED}" => "\x{23EE}", # BLACK RIGHT/LEFT-POINTING DOUBLE TRIANGLE WITH VERTICAL BAR
2400 "\x{261B}" => "\x{261A}", # BLACK RIGHT/LEFT POINTING INDEX
2401 "\x{261E}" => "\x{261C}", # WHITE RIGHT/LEFT POINTING INDEX
2402 "\x{269E}" => "\x{269F}", # THREE LINES CONVERGING RIGHT/LEFT
2403 "\x{2768}" => "\x{2769}", # MEDIUM LEFT/RIGHT PARENTHESIS ORNAMENT
2404 "\x{276A}" => "\x{276B}", # MEDIUM FLATTENED LEFT/RIGHT PARENTHESIS ORNAMENT
2405 "\x{276C}" => "\x{276D}", # MEDIUM LEFT/RIGHT-POINTING ANGLE BRACKET ORNAMENT
2406 "\x{276E}" => "\x{276F}", # HEAVY LEFT/RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT
2407 "\x{2770}" => "\x{2771}", # HEAVY LEFT/RIGHT-POINTING ANGLE BRACKET ORNAMENT
2408 "\x{2772}" => "\x{2773}", # LIGHT LEFT/RIGHT TORTOISE SHELL BRACKET ORNAMENT
2409 "\x{2774}" => "\x{2775}", # MEDIUM LEFT/RIGHT CURLY BRACKET ORNAMENT
2410 "\x{27C3}" => "\x{27C4}", # OPEN SUBSET/SUPERSET
2411 "\x{27C5}" => "\x{27C6}", # LEFT/RIGHT S-SHAPED BAG DELIMITER
2412 "\x{27C8}" => "\x{27C9}", # REVERSE SOLIDUS PRECEDING SUBSET, SUPERSET PRECEDING SOLIDUS
2413 "\x{27DE}" => "\x{27DD}", # LONG LEFT/RIGHT TACK
2414 "\x{27E6}" => "\x{27E7}", # MATHEMATICAL LEFT/RIGHT WHITE SQUARE BRACKET
2415 "\x{27E8}" => "\x{27E9}", # MATHEMATICAL LEFT/RIGHT ANGLE BRACKET
2416 "\x{27EA}" => "\x{27EB}", # MATHEMATICAL LEFT/RIGHT DOUBLE ANGLE BRACKET
2417 "\x{27EC}" => "\x{27ED}", # MATHEMATICAL LEFT/RIGHT WHITE TORTOISE SHELL BRACKET
2418 "\x{27EE}" => "\x{27EF}", # MATHEMATICAL LEFT/RIGHT FLATTENED PARENTHESIS
2419 "\x{27F4}" => "\x{2B32}", # RIGHT/LEFT ARROW WITH CIRCLED PLUS
2420 "\x{27F6}" => "\x{27F5}", # LONG RIGHT/LEFTWARDS ARROW
2421 "\x{27F9}" => "\x{27F8}", # LONG RIGHT/LEFTWARDS DOUBLE ARROW
2422 "\x{27FC}" => "\x{27FB}", # LONG RIGHT/LEFTWARDS ARROW FROM BAR
2423 "\x{27FE}" => "\x{27FD}", # LONG RIGHT/LEFTWARDS DOUBLE ARROW FROM BAR
2424 "\x{27FF}" => "\x{2B33}", # LONG RIGHT/LEFTWARDS SQUIGGLE ARROW
2425 "\x{2900}" => "\x{2B34}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
2426 "\x{2901}" => "\x{2B35}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
2427 "\x{2903}" => "\x{2902}", # RIGHT/LEFTWARDS DOUBLE ARROW WITH VERTICAL STROKE
2428 "\x{2905}" => "\x{2B36}", # RIGHT/LEFTWARDS TWO-HEADED ARROW FROM BAR
2429 "\x{2907}" => "\x{2906}", # RIGHT/LEFTWARDS DOUBLE ARROW FROM BAR
2430 "\x{290D}" => "\x{290C}", # RIGHT/LEFTWARDS DOUBLE DASH ARROW
2431 "\x{290F}" => "\x{290E}", # RIGHT/LEFTWARDS TRIPLE DASH ARROW
2432 "\x{2910}" => "\x{2B37}", # RIGHT/LEFTWARDS TWO-HEADED TRIPLE DASH ARROW
2433 "\x{2911}" => "\x{2B38}", # RIGHT/LEFTWARDS ARROW WITH DOTTED STEM
2434 "\x{2914}" => "\x{2B39}", # RIGHT/LEFTWARDS ARROW WITH TAIL WITH VERTICAL STROKE
2435 "\x{2915}" => "\x{2B3A}", # RIGHT/LEFTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
2436 "\x{2916}" => "\x{2B3B}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TAIL
2437 "\x{2917}" => "\x{2B3C}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE
2438 "\x{2918}" => "\x{2B3D}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
2439 "\x{291A}" => "\x{2919}", # RIGHT/LEFTWARDS ARROW-TAIL
2440 "\x{291C}" => "\x{291B}", # RIGHT/LEFTWARDS DOUBLE ARROW-TAIL
2441 "\x{291E}" => "\x{291D}", # RIGHT/LEFTWARDS ARROW TO BLACK DIAMOND
2442 "\x{2920}" => "\x{291F}", # RIGHT/LEFTWARDS ARROW FROM BAR TO BLACK DIAMOND
2443 "\x{2933}" => "\x{2B3F}", # WAVE ARROW POINTING DIRECTLY RIGHT/LEFT
2444 "\x{2937}" => "\x{2936}", # ARROW POINTING DOWNWARDS THEN CURVING RIGHT/LEFTWARDS
2445 "\x{2945}" => "\x{2946}", # RIGHT/LEFTWARDS ARROW WITH PLUS BELOW
2446 "\x{2947}" => "\x{2B3E}", # RIGHT/LEFTWARDS ARROW THROUGH X
2447 "\x{2953}" => "\x{2952}", # RIGHT/LEFTWARDS HARPOON WITH BARB UP TO BAR
2448 "\x{2957}" => "\x{2956}", # RIGHT/LEFTWARDS HARPOON WITH BARB DOWN TO BAR
2449 "\x{295B}" => "\x{295A}", # RIGHT/LEFTWARDS HARPOON WITH BARB UP FROM BAR
2450 "\x{295F}" => "\x{295E}", # RIGHT/LEFTWARDS HARPOON WITH BARB DOWN FROM BAR
2451 "\x{2964}" => "\x{2962}", # RIGHT/LEFTWARDS HARPOON WITH BARB UP ABOVE RIGHT/LEFTWARDS HARPOON WITH BARB DOWN
2452 "\x{296C}" => "\x{296A}", # RIGHT/LEFTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
2453 "\x{296D}" => "\x{296B}", # RIGHT/LEFTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
2454 "\x{2971}" => "\x{2B40}", # EQUALS SIGN ABOVE RIGHT/LEFTWARDS ARROW
2455 "\x{2972}" => "\x{2B41}", # TILDE OPERATOR ABOVE RIGHTWARDS ARROW, REVERSE TILDE OPERATOR ABOVE LEFTWARDS ARROW
2456 "\x{2974}" => "\x{2B4B}", # RIGHTWARDS ARROW ABOVE TILDE OPERATOR, LEFTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
2457 "\x{2975}" => "\x{2B42}", # RIGHTWARDS ARROW ABOVE ALMOST EQUAL TO, LEFTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO
2458 "\x{2979}" => "\x{297B}", # SUBSET/SUPERSET ABOVE RIGHT/LEFTWARDS ARROW
2459 "\x{2983}" => "\x{2984}", # LEFT/RIGHT WHITE CURLY BRACKET
2460 "\x{2985}" => "\x{2986}", # LEFT/RIGHT WHITE PARENTHESIS
2461 "\x{2987}" => "\x{2988}", # Z NOTATION LEFT/RIGHT IMAGE BRACKET
2462 "\x{2989}" => "\x{298A}", # Z NOTATION LEFT/RIGHT BINDING BRACKET
2463 "\x{298B}" => "\x{298C}", # LEFT/RIGHT SQUARE BRACKET WITH UNDERBAR
2464 "\x{298D}" => "\x{2990}", # LEFT/RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER
2465 "\x{298F}" => "\x{298E}", # LEFT/RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
2466 "\x{2991}" => "\x{2992}", # LEFT/RIGHT ANGLE BRACKET WITH DOT
2467 "\x{2993}" => "\x{2994}", # LEFT/RIGHT ARC LESS-THAN/GREATER-THAN BRACKET
2468 "\x{2995}" => "\x{2996}", # DOUBLE LEFT/RIGHT ARC GREATER-THAN/LESS-THAN BRACKET
2469 "\x{2997}" => "\x{2998}", # LEFT/RIGHT BLACK TORTOISE SHELL BRACKET
2470 "\x{29A8}" => "\x{29A9}", # MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND RIGHT/LEFT
2471 "\x{29AA}" => "\x{29AB}", # MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND RIGHT/LEFT
2472 "\x{29B3}" => "\x{29B4}", # EMPTY SET WITH RIGHT/LEFT ARROW ABOVE
2473 "\x{29C0}" => "\x{29C1}", # CIRCLED LESS-THAN/GREATER-THAN
2474 "\x{29D8}" => "\x{29D9}", # LEFT/RIGHT WIGGLY FENCE
2475 "\x{29DA}" => "\x{29DB}", # LEFT/RIGHT DOUBLE WIGGLY FENCE
2476 "\x{29FC}" => "\x{29FD}", # LEFT/RIGHT-POINTING CURVED ANGLE BRACKET
2477 "\x{2A79}" => "\x{2A7A}", # LESS-THAN/GREATER-THAN WITH CIRCLE INSIDE
2478 "\x{2A7B}" => "\x{2A7C}", # LESS-THAN/GREATER-THAN WITH QUESTION MARK ABOVE
2479 "\x{2A7D}" => "\x{2A7E}", # LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO
2480 "\x{2A7F}" => "\x{2A80}", # LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
2481 "\x{2A81}" => "\x{2A82}", # LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
2482 "\x{2A83}" => "\x{2A84}", # LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE RIGHT/LEFT
2483 "\x{2A85}" => "\x{2A86}", # LESS-THAN/GREATER-THAN OR APPR::XOXIMATE
2484 "\x{2A87}" => "\x{2A88}", # LESS-THAN/GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
2485 "\x{2A89}" => "\x{2A8A}", # LESS-THAN/GREATER-THAN AND NOT APPR::XOXIMATE
2486 "\x{2A8D}" => "\x{2A8E}", # LESS-THAN/GREATER-THAN ABOVE SIMILAR OR EQUAL
2487 "\x{2A95}" => "\x{2A96}", # SLANTED EQUAL TO OR LESS-THAN/GREATER-THAN
2488 "\x{2A97}" => "\x{2A98}", # SLANTED EQUAL TO OR LESS-THAN/GREATER-THAN WITH DOT INSIDE
2489 "\x{2A99}" => "\x{2A9A}", # DOUBLE-LINE EQUAL TO OR LESS-THAN/GREATER-THAN
2490 "\x{2A9B}" => "\x{2A9C}", # DOUBLE-LINE SLANTED EQUAL TO OR LESS-THAN/ GREATER-THAN
2491 "\x{2A9D}" => "\x{2A9E}", # SIMILAR OR LESS-THAN/GREATER-THAN
2492 "\x{2A9F}" => "\x{2AA0}", # SIMILAR ABOVE LESS-THAN/GREATER-THAN ABOVE EQUALS SIGN
2493 "\x{2AA1}" => "\x{2AA2}", # DOUBLE NESTED LESS-THAN/GREATER-THAN
2494 "\x{2AA6}" => "\x{2AA7}", # LESS-THAN/GREATER-THAN CLOSED BY CURVE
2495 "\x{2AA8}" => "\x{2AA9}", # LESS-THAN/GREATER-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
2496 "\x{2AAA}" => "\x{2AAB}", # SMALLER THAN/LARGER THAN
2497 "\x{2AAC}" => "\x{2AAD}", # SMALLER THAN/LARGER THAN OR EQUAL TO
2498 "\x{2AAF}" => "\x{2AB0}", # PRECEDES/SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
2499 "\x{2AB1}" => "\x{2AB2}", # PRECEDES/SUCCEEDS ABOVE SINGLE-LINE NOT EQUAL TO
2500 "\x{2AB3}" => "\x{2AB4}", # PRECEDES/SUCCEEDS ABOVE EQUALS SIGN
2501 "\x{2AB5}" => "\x{2AB6}", # PRECEDES/SUCCEEDS ABOVE NOT EQUAL TO
2502 "\x{2AB7}" => "\x{2AB8}", # PRECEDES/SUCCEEDS ABOVE ALMOST EQUAL TO
2503 "\x{2AB9}" => "\x{2ABA}", # PRECEDES/SUCCEEDS ABOVE NOT ALMOST EQUAL TO
2504 "\x{2ABB}" => "\x{2ABC}", # DOUBLE PRECEDES/SUCCEEDS
2505 "\x{2ABD}" => "\x{2ABE}", # SUBSET/SUPERSET WITH DOT
2506 "\x{2ABF}" => "\x{2AC0}", # SUBSET/SUPERSET WITH PLUS SIGN BELOW
2507 "\x{2AC1}" => "\x{2AC2}", # SUBSET/SUPERSET WITH MULTIPLICATION SIGN BELOW
2508 "\x{2AC3}" => "\x{2AC4}", # SUBSET/SUPERSET OF OR EQUAL TO WITH DOT ABOVE
2509 "\x{2AC5}" => "\x{2AC6}", # SUBSET/SUPERSET OF ABOVE EQUALS SIGN
2510 "\x{2AC7}" => "\x{2AC8}", # SUBSET/SUPERSET OF ABOVE TILDE OPERATOR
2511 "\x{2AC9}" => "\x{2ACA}", # SUBSET/SUPERSET OF ABOVE ALMOST EQUAL TO
2512 "\x{2ACB}" => "\x{2ACC}", # SUBSET/SUPERSET OF ABOVE NOT EQUAL TO
2513 "\x{2ACF}" => "\x{2AD0}", # CLOSED SUBSET/SUPERSET
2514 "\x{2AD1}" => "\x{2AD2}", # CLOSED SUBSET/SUPERSET OR EQUAL TO
2515 "\x{2AD5}" => "\x{2AD6}", # SUBSET/SUPERSET ABOVE SUBSET/SUPERSET
2516 "\x{2AE5}" => "\x{22AB}", # DOUBLE VERTICAL BAR DOUBLE LEFT/RIGHT TURNSTILE
2517 "\x{2AF7}" => "\x{2AF8}", # TRIPLE NESTED LESS-THAN/GREATER-THAN
2518 "\x{2AF9}" => "\x{2AFA}", # DOUBLE-LINE SLANTED LESS-THAN/GREATER-THAN OR EQUAL TO
2519 "\x{2B46}" => "\x{2B45}", # RIGHT/LEFTWARDS QUADRUPLE ARROW
2520 "\x{2B47}" => "\x{2B49}", # REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW, TILDE OPERATOR ABOVE LEFTWARDS ARROW
2521 "\x{2B48}" => "\x{2B4A}", # RIGHTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO, LEFTWARDS ARROW ABOVE ALMOST EQUAL TO
2522 "\x{2B4C}" => "\x{2973}", # RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR, LEFTWARDS ARROW ABOVE TILDE OPERATOR
2523 "\x{2B62}" => "\x{2B60}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW
2524 "\x{2B6C}" => "\x{2B6A}", # RIGHT/LEFTWARDS TRIANGLE-HEADED DASHED ARROW
2525 "\x{2B72}" => "\x{2B70}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW TO BAR
2526 "\x{2B7C}" => "\x{2B7A}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH DOUBLE VERTICAL STROKE
2527 "\x{2B86}" => "\x{2B84}", # RIGHT/LEFTWARDS TRIANGLE-HEADED PAIRED ARROWS
2528 "\x{2B8A}" => "\x{2B88}", # RIGHT/LEFTWARDS BLACK CIRCLED WHITE ARROW
2529 "\x{2B95}" => "\x{2B05}", # RIGHT/LEFTWARDS BLACK ARROW
2530 "\x{2B9A}" => "\x{2B98}", # THREE-D TOP-LIGHTED RIGHT/LEFTWARDS EQUILATERAL ARROWHEAD
2531 "\x{2B9E}" => "\x{2B9C}", # BLACK RIGHT/LEFTWARDS EQUILATERAL ARROWHEAD
2532 "\x{2BA1}" => "\x{2BA0}", # DOWNWARDS TRIANGLE-HEADED ARROW WITH LONG TIP RIGHT/LEFTWARDS
2533 "\x{2BA3}" => "\x{2BA2}", # UPWARDS TRIANGLE-HEADED ARROW WITH LONG TIP RIGHT/LEFTWARDS
2534 "\x{2BA9}" => "\x{2BA8}", # BLACK CURVED DOWNWARDS AND RIGHT/LEFTWARDS ARROW
2535 "\x{2BAB}" => "\x{2BAA}", # BLACK CURVED UPWARDS AND RIGHT/LEFTWARDS ARROW
2536 "\x{2BB1}" => "\x{2BB0}", # RIBBON ARROW DOWN RIGHT/LEFT
2537 "\x{2BB3}" => "\x{2BB2}", # RIBBON ARROW UP RIGHT/LEFT
2538 "\x{2BEE}" => "\x{2BEC}", # RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TRIANGLE ARROWHEADS
2539 "\x{2E02}" => "\x{2E03}", # LEFT/RIGHT SUBSTITUTION BRACKET
2540 "\x{2E03}" => "\x{2E02}", # RIGHT/LEFT SUBSTITUTION BRACKET
2541 "\x{2E04}" => "\x{2E05}", # LEFT/RIGHT DOTTED SUBSTITUTION BRACKET
2542 "\x{2E05}" => "\x{2E04}", # RIGHT/LEFT DOTTED SUBSTITUTION BRACKET
2543 "\x{2E09}" => "\x{2E0A}", # LEFT/RIGHT TRANSPOSITION BRACKET
2544 "\x{2E0A}" => "\x{2E09}", # RIGHT/LEFT TRANSPOSITION BRACKET
2545 "\x{2E0C}" => "\x{2E0D}", # LEFT/RIGHT RAISED OMISSION BRACKET
2546 "\x{2E0D}" => "\x{2E0C}", # RIGHT/LEFT RAISED OMISSION BRACKET
2547 "\x{2E11}" => "\x{2E10}", # REVERSED FORKED PARAGRAPHOS, FORKED PARAGRAPHOS
2548 "\x{2E1C}" => "\x{2E1D}", # LEFT/RIGHT LOW PARAPHRASE BRACKET
2549 "\x{2E1D}" => "\x{2E1C}", # RIGHT/LEFT LOW PARAPHRASE BRACKET
2550 "\x{2E20}" => "\x{2E21}", # LEFT/RIGHT VERTICAL BAR WITH QUILL
2551 "\x{2E21}" => "\x{2E20}", # RIGHT/LEFT VERTICAL BAR WITH QUILL
2552 "\x{2E22}" => "\x{2E23}", # TOP LEFT/RIGHT HALF BRACKET
2553 "\x{2E24}" => "\x{2E25}", # BOTTOM LEFT/RIGHT HALF BRACKET
2554 "\x{2E26}" => "\x{2E27}", # LEFT/RIGHT SIDEWAYS U BRACKET
2555 "\x{2E28}" => "\x{2E29}", # LEFT/RIGHT DOUBLE PARENTHESIS
2556 "\x{2E36}" => "\x{2E37}", # DAGGER WITH LEFT/RIGHT GUARD
2557 "\x{2E42}" => "\x{201E}", # DOUBLE LOW-REVERSED-9 QUOTATION MARK, DOUBLE LOW-9 QUOTATION MARK
2558 "\x{2E55}" => "\x{2E56}", # LEFT/RIGHT SQUARE BRACKET WITH STROKE
2559 "\x{2E57}" => "\x{2E58}", # LEFT/RIGHT SQUARE BRACKET WITH DOUBLE STROKE
2560 "\x{2E59}" => "\x{2E5A}", # TOP HALF LEFT/RIGHT PARENTHESIS
2561 "\x{2E5B}" => "\x{2E5C}", # BOTTOM HALF LEFT/RIGHT PARENTHESIS
2562 "\x{3008}" => "\x{3009}", # LEFT/RIGHT ANGLE BRACKET
2563 "\x{300A}" => "\x{300B}", # LEFT/RIGHT DOUBLE ANGLE BRACKET
2564 "\x{300C}" => "\x{300D}", # LEFT/RIGHT CORNER BRACKET
2565 "\x{300E}" => "\x{300F}", # LEFT/RIGHT WHITE CORNER BRACKET
2566 "\x{3010}" => "\x{3011}", # LEFT/RIGHT BLACK LENTICULAR BRACKET
2567 "\x{3014}" => "\x{3015}", # LEFT/RIGHT TORTOISE SHELL BRACKET
2568 "\x{3016}" => "\x{3017}", # LEFT/RIGHT WHITE LENTICULAR BRACKET
2569 "\x{3018}" => "\x{3019}", # LEFT/RIGHT WHITE TORTOISE SHELL BRACKET
2570 "\x{301A}" => "\x{301B}", # LEFT/RIGHT WHITE SQUARE BRACKET
2571 "\x{301D}" => "\x{301E}", # REVERSED DOUBLE PRIME QUOTATION MARK, DOUBLE PRIME QUOTATION MARK
2572 "\x{A9C1}" => "\x{A9C2}", # JAVANESE LEFT/RIGHT RERENGGAN
2573 "\x{FD3E}" => "\x{FD3F}", # ORNATE LEFT/RIGHT PARENTHESIS
2574 "\x{FE59}" => "\x{FE5A}", # SMALL LEFT/RIGHT PARENTHESIS
2575 "\x{FE5B}" => "\x{FE5C}", # SMALL LEFT/RIGHT CURLY BRACKET
2576 "\x{FE5D}" => "\x{FE5E}", # SMALL LEFT/RIGHT TORTOISE SHELL BRACKET
2577 "\x{FE64}" => "\x{FE65}", # SMALL LESS-THAN/GREATER-THAN SIGN
2578 "\x{FF08}" => "\x{FF09}", # FULLWIDTH LEFT/RIGHT PARENTHESIS
2579 "\x{FF1C}" => "\x{FF1E}", # FULLWIDTH LESS-THAN/GREATER-THAN SIGN
2580 "\x{FF3B}" => "\x{FF3D}", # FULLWIDTH LEFT/RIGHT SQUARE BRACKET
2581 "\x{FF5B}" => "\x{FF5D}", # FULLWIDTH LEFT/RIGHT CURLY BRACKET
2582 "\x{FF5F}" => "\x{FF60}", # FULLWIDTH LEFT/RIGHT WHITE PARENTHESIS
2583 "\x{FF62}" => "\x{FF63}", # HALFWIDTH LEFT/RIGHT CORNER BRACKET
2584 "\x{FFEB}" => "\x{FFE9}", # HALFWIDTH RIGHT/LEFTWARDS ARROW
2585 "\x{1D103}" => "\x{1D102}", # MUSICAL SYMBOL REVERSE FINAL BARLINE, MUSICAL SYMBOL FINAL BARLINE
2586 "\x{1D106}" => "\x{1D107}", # MUSICAL SYMBOL LEFT/RIGHT REPEAT SIGN
2587 "\x{1F449}" => "\x{1F448}", # WHITE RIGHT/LEFT POINTING BACKHAND INDEX
2588 "\x{1F508}" => "\x{1F568}", # SPEAKER, RIGHT SPEAKER
2589 "\x{1F509}" => "\x{1F569}", # SPEAKER WITH ONE SOUND WAVE, RIGHT SPEAKER WITH ONE SOUND WAVE
2590 "\x{1F50A}" => "\x{1F56A}", # SPEAKER WITH THREE SOUND WAVES, RIGHT SPEAKER WITH THREE SOUND WAVES
2591 "\x{1F57B}" => "\x{1F57D}", # LEFT/RIGHT HAND TELEPHONE RECEIVER
2592 "\x{1F599}" => "\x{1F598}", # SIDEWAYS WHITE RIGHT/LEFT POINTING INDEX
2593 "\x{1F59B}" => "\x{1F59A}", # SIDEWAYS BLACK RIGHT/LEFT POINTING INDEX
2594 "\x{1F59D}" => "\x{1F59C}", # BLACK RIGHT/LEFT POINTING BACKHAND INDEX
2595 "\x{1F5E6}" => "\x{1F5E7}", # THREE RAYS LEFT/RIGHT
2596 "\x{1F802}" => "\x{1F800}", # RIGHT/LEFTWARDS ARROW WITH SMALL TRIANGLE ARROWHEAD
2597 "\x{1F806}" => "\x{1F804}", # RIGHT/LEFTWARDS ARROW WITH MEDIUM TRIANGLE ARROWHEAD
2598 "\x{1F80A}" => "\x{1F808}", # RIGHT/LEFTWARDS ARROW WITH LARGE TRIANGLE ARROWHEAD
2599 "\x{1F812}" => "\x{1F810}", # RIGHT/LEFTWARDS ARROW WITH SMALL EQUILATERAL ARROWHEAD
2600 "\x{1F816}" => "\x{1F814}", # RIGHT/LEFTWARDS ARROW WITH EQUILATERAL ARROWHEAD
2601 "\x{1F81A}" => "\x{1F818}", # HEAVY RIGHT/LEFTWARDS ARROW WITH EQUILATERAL ARROWHEAD
2602 "\x{1F81E}" => "\x{1F81C}", # HEAVY RIGHT/LEFTWARDS ARROW WITH LARGE EQUILATERAL ARROWHEAD
2603 "\x{1F822}" => "\x{1F820}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH NARROW SHAFT
2604 "\x{1F826}" => "\x{1F824}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH MEDIUM SHAFT
2605 "\x{1F82A}" => "\x{1F828}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH BOLD SHAFT
2606 "\x{1F82E}" => "\x{1F82C}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH HEAVY SHAFT
2607 "\x{1F832}" => "\x{1F830}", # RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH VERY HEAVY SHAFT
2608 "\x{1F836}" => "\x{1F834}", # RIGHT/LEFTWARDS FINGER-POST ARROW
2609 "\x{1F83A}" => "\x{1F838}", # RIGHT/LEFTWARDS SQUARED ARROW
2610 "\x{1F83E}" => "\x{1F83C}", # RIGHT/LEFTWARDS COMPRESSED ARROW
2611 "\x{1F842}" => "\x{1F840}", # RIGHT/LEFTWARDS HEAVY COMPRESSED ARROW
2612 "\x{1F846}" => "\x{1F844}", # RIGHT/LEFTWARDS HEAVY ARROW
2613 "\x{1F852}" => "\x{1F850}", # RIGHT/LEFTWARDS SANS-SERIF ARROW
2614 "\x{1F862}" => "\x{1F860}", # WIDE-HEADED RIGHT/LEFTWARDS LIGHT BARB ARROW
2615 "\x{1F86A}" => "\x{1F868}", # WIDE-HEADED RIGHT/LEFTWARDS BARB ARROW
2616 "\x{1F872}" => "\x{1F870}", # WIDE-HEADED RIGHT/LEFTWARDS MEDIUM BARB ARROW
2617 "\x{1F87A}" => "\x{1F878}", # WIDE-HEADED RIGHT/LEFTWARDS HEAVY BARB ARROW
2618 "\x{1F882}" => "\x{1F880}", # WIDE-HEADED RIGHT/LEFTWARDS VERY HEAVY BARB ARROW
2619 "\x{1F892}" => "\x{1F890}", # RIGHT/LEFTWARDS TRIANGLE ARROWHEAD
2620 "\x{1F896}" => "\x{1F894}", # RIGHT/LEFTWARDS WHITE ARROW WITHIN TRIANGLE ARROWHEAD
2621 "\x{1F89A}" => "\x{1F898}", # RIGHT/LEFTWARDS ARROW WITH NOTCHED TAIL
2622 "\x{1F8A1}" => "\x{1F8A0}", # RIGHTWARDS BOTTOM SHADED WHITE ARROW, LEFTWARDS BOTTOM-SHADED WHITE ARROW
2623 "\x{1F8A3}" => "\x{1F8A2}", # RIGHT/LEFTWARDS TOP SHADED WHITE ARROW
2624 "\x{1F8A5}" => "\x{1F8A6}", # RIGHT/LEFTWARDS RIGHT-SHADED WHITE ARROW
2625 "\x{1F8A7}" => "\x{1F8A4}", # RIGHT/LEFTWARDS LEFT-SHADED WHITE ARROW
2626 "\x{1F8A9}" => "\x{1F8A8}", # RIGHT/LEFTWARDS BACK-TILTED SHADOWED WHITE ARROW
2627 "\x{1F8AB}" => "\x{1F8AA}", # RIGHT/LEFTWARDS FRONT-TILTED SHADOWED WHITE ARROW
2628 );
2629 }
2630  
2631 sub decomment {
2632 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
2633  
2634 0 my ($str) = @_;
2635  
2636 0 local %PPR::X::comment_len;
2637  
2638 # Locate comments...
2639 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
2640  
2641 (?(DEFINE)
2642 (?<decomment>
2643 ( (?<! [\$@%] ) [#] [^\n]*+ )
2644 (?{
2645 0 my $len = length($^N);
2646 0 my $pos = pos() - $len;
2647 0 $PPR::X::comment_len{$pos} = $len;
2648 })
2649 )
2650  
2651 (?<PerlOWS>
2652 (?:
2653 \h++
2654 |
2655 (?&PPR_X_newline_and_heredoc)
2656 |
2657 (?&decomment)
2658 |
2659 __ (?> END | DATA ) __ \b .*+ \z
2660 )*+
2661 ) # End of rule
2662  
2663 (?<PerlNWS>
2664 (?:
2665 \h++
2666 |
2667 (?&PPR_X_newline_and_heredoc)
2668 |
2669 (?&decomment)
2670 |
2671 __ (?> END | DATA ) __ \b .*+ \z
2672 )++
2673  
2674 ) # End of rule
2675  
2676 (?<PerlPod>
2677 (
2678 ^ = [^\W\d]\w*+
2679 .*?
2680 (?>
2681 ^ = cut \b [^\n]*+ $
2682 |
2683 \z
2684 )
2685 )
2686 (?{
2687 0 my $len = length($^N);
2688 0 my $pos = pos() - $len;
2689 0 $PPR::X::comment_len{$pos} = $len;
2690 })
2691 ) # End of rule
2692  
2693 $PPR::X::GRAMMAR
2694 )
2695 }xms or return;
2696  
2697 # Delete the comments found...
2698 0 for my $from_pos (_uniq(sort { $b <=> $a } keys %PPR::X::comment_len)) {
2699 0 substr($str, $from_pos, $PPR::X::comment_len{$from_pos}) =~ s/.+//g;
2700 }
2701  
2702 0 return $str;
2703 }
2704  
2705 sub _uniq {
2706 0 ▶ my %seen;
Subroutine _uniq: not called CC=1 SCAR=6.9
2707 0 return grep {!$seen{$_}++} @_;
2708 }
2709  
2710 sub _croak {
2711 0 ▶ require Carp;
Subroutine _croak: not called CC=1 SCAR=6.9
2712 0 Carp::croak(@_);
2713 }
2714  
2715 sub _report {
2716 0 ▶ state $CONTEXT_WIDTH = 20;
Subroutine _report: not called CC=4 SCAR=26.1
2717 0 state $BUFFER = q{ } x $CONTEXT_WIDTH;
2718 0 state $depth = 0;
2719 0 my ($msg, $increment) = @_;
2720 0 ▶ $depth++ if $increment;
Branch: 1 branch
BranchTrueFalseTotal
if $increment 0 0 0
2721 0 my $at = pos();
2722 0 my $str = $BUFFER . $_ . $BUFFER;
2723 0 my $pre = substr($str, $at, $CONTEXT_WIDTH);
2724 0 my $post = substr($str, $at+$CONTEXT_WIDTH, $CONTEXT_WIDTH);
2725 0 tr/\n/ / for $pre, $post;
2726 6 ▶ no warnings 'utf8';
Subroutine BEGIN: called CC=1 SCAR=0.0
2727 0 warn sprintf("%05d āŽœ%*sāŽœ%-*sāŽœ %s%s\n",
2728 $at, $CONTEXT_WIDTH, $pre, $CONTEXT_WIDTH, $post, q{ } x $depth, $msg);
2729 0 ▶ $depth-- if !$increment;
Branch: 1 branch
BranchTrueFalseTotal
if not $increment 0 0 0
2730 }
2731  
2732 6 1; # Magic true value required at end of module
2733  
2734 __END__
↑ Summary PPR.pm »