File Coverage

t/flags.xs
Criterion Covered Total %
statement 4 4 100.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             /* You may distribute under the terms of either the GNU General Public License
2             * or the Artistic License (the same terms as Perl itself)
3             *
4             * (C) Paul Evans, 2021 -- leonerd@leonerd.org.uk
5             */
6              
7             #include "EXTERN.h"
8             #include "perl.h"
9             #include "XSUB.h"
10              
11             #include "XSParseKeyword.h"
12              
13             static const char hintkey[] = "t::flags/permit";
14              
15 2           static int build_ident(pTHX_ OP **out, XSParseKeywordPiece *arg0, void *hookdata)
16             {
17 2           *out = newSVOP(OP_CONST, 0, arg0->sv);
18 2           return KEYWORD_PLUGIN_STMT;
19             }
20              
21             static const struct XSParseKeywordHooks hooks_autosemi = {
22             .flags = XPK_FLAG_STMT|XPK_FLAG_AUTOSEMI,
23             .permit_hintkey = hintkey,
24              
25             .piece1 = XPK_IDENT,
26             .build1 = &build_ident,
27             };
28              
29             MODULE = t::flags PACKAGE = t::flags
30              
31             BOOT:
32 1           boot_xs_parse_keyword(0);
33              
34             register_xs_parse_keyword("flagautosemi", &hooks_autosemi, NULL);