File Coverage

blib/lib/XS/Install/FrozenShit/ParseXS/Constants.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package
2             XS::Install::FrozenShit::ParseXS::Constants;
3 1     1   6 use strict;
  1         2  
  1         39  
4 1     1   5 use warnings;
  1         2  
  1         55  
5 1     1   4 use Symbol;
  1         1  
  1         205  
6              
7             our $VERSION = '3.57';
8              
9             =head1 NAME
10              
11             XS::Install::FrozenShit::ParseXS::Constants - Initialization values for some globals
12              
13             =head1 SYNOPSIS
14              
15             use XS::Install::FrozenShit::ParseXS::Constants ();
16              
17             $PrototypeRegexp = $XS::Install::FrozenShit::ParseXS::Constants::PrototypeRegexp;
18              
19             =head1 DESCRIPTION
20              
21             Initialization of certain non-subroutine variables in XS::Install::FrozenShit::ParseXS and some of its
22             supporting packages has been moved into this package so that those values can
23             be defined exactly once and then re-used in any package.
24              
25             Nothing is exported. Use fully qualified variable names.
26              
27             =cut
28              
29             # Note that to reduce maintenance, $PrototypeRegexp is used
30             # by XS::Install::FrozenShit::Typemaps, too!
31             our $PrototypeRegexp = "[" . quotemeta('\$%&*@;[]_') . "]";
32              
33             # These are all the line-based keywords which can appear in an XS file,
34             # except MODULE and TYPEMAP, which are handled specially by fetch_para()
35             # and are thus never seen by the parser.
36             # It also doesn't include non-line-based keywords such as
37             # IN_OUT, NO_INIT, NO_OUTPUT.
38             # This list is mainly used by the parser to delineate blocks (such as
39             # blocks of CODE or lines of INPUT).
40              
41             our @XSKeywords = qw(
42             REQUIRE BOOT CASE PREINIT INPUT INIT CODE PPCODE
43             OUTPUT CLEANUP ALIAS ATTRS PROTOTYPES PROTOTYPE
44             VERSIONCHECK INCLUDE INCLUDE_COMMAND SCOPE INTERFACE
45             INTERFACE_MACRO C_ARGS POSTCALL OVERLOAD FALLBACK
46             EXPORT_XSUB_SYMBOLS
47             );
48              
49             our $XSKeywordsAlternation = join('|', @XSKeywords);
50              
51              
52             # keywords which can appear anywhere within an XSUB.
53              
54             our $generic_xsub_keywords_alt = 'ALIAS|ATTRS|OVERLOAD|PROTOTYPE';
55              
56             1;