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, 2016-2021 -- leonerd@leonerd.org.uk |
5
|
|
|
|
|
|
|
*/ |
6
|
|
|
|
|
|
|
#include "EXTERN.h" |
7
|
|
|
|
|
|
|
#include "perl.h" |
8
|
|
|
|
|
|
|
#include "XSUB.h" |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#include "XSParseInfix.h" |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#define HAVE_PERL_VERSION(R, V, S) \ |
13
|
|
|
|
|
|
|
(PERL_REVISION > (R) || (PERL_REVISION == (R) && (PERL_VERSION > (V) || (PERL_VERSION == (V) && (PERL_SUBVERSION >= (S)))))) |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#include "newOP_CUSTOM.c.inc" |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
|
static OP *pp_divides(pTHX) |
18
|
|
|
|
|
|
|
{ |
19
|
|
|
|
|
|
|
dSP; |
20
|
|
|
|
|
|
|
|
21
|
2
|
|
|
|
|
|
(PL_ppaddr[OP_MODULO])(aTHX); |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
|
SPAGAIN; |
24
|
|
|
|
|
|
|
|
25
|
2
|
50
|
|
|
|
|
if(SvTRUE(TOPs)) { |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
26
|
1
|
|
|
|
|
|
*SP = &PL_sv_no; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
else { |
29
|
1
|
|
|
|
|
|
*SP = &PL_sv_yes; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
|
return NORMAL; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
5
|
|
|
|
|
|
static OP *new_op_divides(pTHX_ U32 flags, OP *lhs, OP *rhs, SV **parsedata, void *hookdata) |
36
|
|
|
|
|
|
|
{ |
37
|
|
|
|
|
|
|
OP *ret = newBINOP_CUSTOM(&pp_divides, flags, lhs, rhs); |
38
|
5
|
|
|
|
|
|
ret->op_targ = pad_alloc(OP_CUSTOM, SVs_PADTMP); |
39
|
5
|
|
|
|
|
|
return ret; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
static const struct XSParseInfixHooks hooks_divides = { |
43
|
|
|
|
|
|
|
.cls = XPI_CLS_MATCH_MISC, |
44
|
|
|
|
|
|
|
.wrapper_func_name = "Syntax::Operator::Divides::is_divisor", |
45
|
|
|
|
|
|
|
.permit_hintkey = "Syntax::Operator::Divides/divides", |
46
|
|
|
|
|
|
|
.new_op = &new_op_divides, |
47
|
|
|
|
|
|
|
.ppaddr = &pp_divides, |
48
|
|
|
|
|
|
|
}; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
MODULE = Syntax::Operator::Divides PACKAGE = Syntax::Operator::Divides |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
BOOT: |
53
|
3
|
|
|
|
|
|
boot_xs_parse_infix(0.27); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
register_xs_parse_infix("%%", &hooks_divides, NULL); |