PPI/Singletons.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 22 / 22 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« PPI/Exception/ParserRejection.pm ↑ Summary PPI/Statement/Break.pm »
1 package PPI::Singletons;
2  
3 # exports some singleton variables to avoid aliasing magic
4  
5 63 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 63 ▶use Exporter ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 63 our $VERSION = '1.260'; # VERSION
9  
10 63 our @ISA = 'Exporter';
11 63 our @EXPORT_OK = qw{ %_PARENT %OPERATOR %MAGIC %LAYER $CURLY_SYMBOL %QUOTELIKE %KEYWORDS };
12  
13 63 our %_PARENT; # Master Child -> Parent index
14  
15 # operator index
16 63 our %OPERATOR = map { $_ => 1 } (
17 qw{
18 -> ++ -- ** ! ~ + -
19 =~ !~ * / % x . << >>
20 < > <= >= lt gt le ge
21 == != <=> eq ne cmp ~~
22 & | ^ && || // .. ...
23 ? :
24 = **= += -= .= *= /= %= x= &= |= ^= <<= >>= &&= ||= //=
25 => <> <<>>
26 and or xor not
27 }, ',' # Avoids "comma in qw{}" warning
28 );
29  
30 # Magic variables taken from perlvar.
31 # Several things added separately to avoid warnings.
32 63 our %MAGIC = map { $_ => 1 } qw{
33 $1 $2 $3 $4 $5 $6 $7 $8 $9
34 $_ $& $` $' $+ @+ %+ $* $. $/ $|
35 $\\ $" $; $% $= $- @- %- $)
36 $~ $^ $: $? $! %! $@ $$ $< $>
37 $( $0 $[ $] @_ @*
38  
39 $^L $^A $^E $^C $^D $^F $^H
40 $^I $^M $^N $^O $^P $^R $^S
41 $^T $^V $^W $^X %^H
42  
43 $::|
44 }, '$}', '$,', '$#', '$#+', '$#-';
45  
46 63 our %LAYER = ( 1 => [], 2 => [] ); # Registered function store
47  
48 63 our $CURLY_SYMBOL = qr{\G\^[[:upper:]_]\w+\}};
49  
50 63 our %QUOTELIKE = (
51 'q' => 'Quote::Literal',
52 'qq' => 'Quote::Interpolate',
53 'qx' => 'QuoteLike::Command',
54 'qw' => 'QuoteLike::Words',
55 'qr' => 'QuoteLike::Regexp',
56 'm' => 'Regexp::Match',
57 's' => 'Regexp::Substitute',
58 'tr' => 'Regexp::Transliterate',
59 'y' => 'Regexp::Transliterate',
60 );
61  
62 # List of keywords is from regen/keywords.pl in the perl source.
63 63 our %KEYWORDS = map { $_ => 1 } qw{
64 abs accept alarm and atan2 bind binmode bless break caller chdir chmod
65 chomp chop chown chr chroot close closedir cmp connect continue cos
66 crypt dbmclose dbmopen default defined delete die do dump each else
67 elsif endgrent endhostent endnetent endprotoent endpwent endservent
68 eof eq eval evalbytes exec exists exit exp fc fcntl fileno flock for
69 foreach fork format formline ge getc getgrent getgrgid getgrnam
70 gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr
71 getnetbyname getnetent getpeername getpgrp getppid getpriority
72 getprotobyname getprotobynumber getprotoent getpwent getpwnam
73 getpwuid getservbyname getservbyport getservent getsockname
74 getsockopt given glob gmtime goto grep gt hex if index int ioctl join
75 keys kill last lc lcfirst le length link listen local localtime lock
76 log lstat lt m map mkdir msgctl msgget msgrcv msgsnd my ne next no
77 not oct open opendir or ord our pack package pipe pop pos print
78 printf prototype push q qq qr quotemeta qw qx rand read readdir
79 readline readlink readpipe recv redo ref rename require reset return
80 reverse rewinddir rindex rmdir s say scalar seek seekdir select semctl
81 semget semop send setgrent sethostent setnetent setpgrp
82 setpriority setprotoent setpwent setservent setsockopt shift shmctl
83 shmget shmread shmwrite shutdown sin sleep socket socketpair sort
84 splice split sprintf sqrt srand stat state study sub substr symlink
85 syscall sysopen sysread sysseek system syswrite tell telldir tie tied
86 time times tr truncate uc ucfirst umask undef unless unlink unpack
87 unshift untie until use utime values vec wait waitpid wantarray warn
88 when while write x xor y
89 };
90  
91 63 1;
« PPI/Exception/ParserRejection.pm ↑ Summary PPI/Statement/Break.pm »