| 1 | package PPIx::QuoteLike::Constant; | ||
| 2 | |||
| 3 | 8 | ▶ | use 5.006; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 8 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 8 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 8 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 8 | ▶ | use base qw{ Exporter }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 8 | our $VERSION = '0.024'; | |
| 12 | |||
| 13 | 8 | ▶ | no warnings qw{ once }; # For older Perls. |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 8 | our @CARP_NOT = qw{ | |
| 16 | PPIx::QuoteLike | ||
| 17 | PPIx::QuoteLike::Constant | ||
| 18 | PPIx::QuoteLike::Dumper | ||
| 19 | PPIx::QuoteLike::Token | ||
| 20 | PPIx::QuoteLike::Token::Control | ||
| 21 | PPIx::QuoteLike::Token::Delimiter | ||
| 22 | PPIx::QuoteLike::Token::Interpolation | ||
| 23 | PPIx::QuoteLike::Token::String | ||
| 24 | PPIx::QuoteLike::Token::Structure | ||
| 25 | PPIx::QuoteLike::Token::Unknown | ||
| 26 | PPIx::QuoteLike::Token::Whitespace | ||
| 27 | PPIx::QuoteLike::Utils | ||
| 28 | }; | ||
| 29 | |||
| 30 | 8 | ▶ | use warnings qw{ once }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 31 | |||
| 32 | 8 | our @EXPORT_OK = qw{ | |
| 33 | ARRAY_REF | ||
| 34 | MINIMUM_PERL | ||
| 35 | HAVE_PPIX_REGEXP | ||
| 36 | LOCATION_LINE | ||
| 37 | LOCATION_CHARACTER | ||
| 38 | LOCATION_COLUMN | ||
| 39 | LOCATION_LOGICAL_LINE | ||
| 40 | LOCATION_LOGICAL_FILE | ||
| 41 | SUFFICIENT_UTF8_SUPPORT_FOR_WEIRD_DELIMITERS | ||
| 42 | VARIABLE_RE | ||
| 43 | @CARP_NOT | ||
| 44 | }; | ||
| 45 | |||
| 46 | 8 | ▶ | use constant ARRAY_REF => ref []; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 47 | |||
| 48 | # We can't depend on PPIx::Regexp without getting into a circular | ||
| 49 | # dependency. I think. But we can sure use it if we can come by it. | ||
| 50 | 8 | ▶ | use constant HAVE_PPIX_REGEXP => do { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 51 | 8 | local $@ = undef; | |
| 52 | 8 | eval { ## no critic (RequireCheckingReturnValueOfEval) | |
| 53 | 8 | require PPIx::Regexp; | |
| 54 | 0 | 1; | |
| 55 | }; | ||
| 56 | 8 | }; | |
| 57 | |||
| 58 | # The '## VERBATIM' annotations support test xt/author/verbatim.t | ||
| 59 | ## VERBATIM EXPECT 1 | ||
| 60 | ## VERBATIM BEGIN PPI::Document | ||
| 61 | 8 | ▶ | use constant LOCATION_LINE => 0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 62 | 8 | ▶ | use constant LOCATION_CHARACTER => 1; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 63 | 8 | ▶ | use constant LOCATION_COLUMN => 2; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 64 | 8 | ▶ | use constant LOCATION_LOGICAL_LINE => 3; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 65 | 8 | ▶ | use constant LOCATION_LOGICAL_FILE => 4; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 66 | ## VERBATIM END | ||
| 67 | |||
| 68 | 8 | ▶ | use constant MINIMUM_PERL => '5.000'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 69 | |||
| 70 | 8 | ▶ | use constant SUFFICIENT_UTF8_SUPPORT_FOR_WEIRD_DELIMITERS => $] ge '5.008003'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 71 | |||
| 72 | # Match the name of a variable. The user of this needs to anchor it | ||
| 73 | # right after the sigil. The line noise is [[:punct:]] as documented in | ||
| 74 | # perlrecharclass, less anything that needs to be excluded (currently | ||
| 75 | # only '@' and '*'). | ||
| 76 | 8 | ▶ | use constant VARIABLE_RE => qr/ |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 77 | [[:alpha:]_]\w* (?: :: [[:alpha:]_] \w* )* | | ||
| 78 | \^ [A-Z_] | | ||
| 79 | [0-9]+ | | ||
| 80 | [-!"#\$%&'()+,.\/:;<=>?[\\\]^_`{|}~] | ||
| 81 | 8 | /smx; | |
| 82 | |||
| 83 | 8 | 1; | |
| 84 | |||
| 85 | __END__ | ||