dSP;
struct regexp * rx;
REGEXP *RX;
- I32 buffers;
+
re__engine__Plugin re;
const rep_hint_t *h;
+ STRLEN plen;
+ char *pbuf;
+
+ SV *obj;
+
h = rep_hint();
if (!h) /* This looks like a pragma leak. Apply the default behaviour */
return re_compile(pattern, flags);
/* exp/xend version of the pattern & length */
- STRLEN plen;
- char* exp = SvPV((SV*)pattern, plen);
+ pbuf = SvPV((SV*)pattern, plen);
/* Our blessed object */
- SV *obj = newSV(0);
+ obj = newSV(0);
SvREFCNT_inc(obj);
Newxz(re, 1, struct replug);
sv_setref_pv(obj, "re::engine::Plugin", (void*)re);
/* Precompiled pattern for pp_regcomp to use */
rx->prelen = plen;
- rx->precomp = savepvn(exp, rx->prelen);
+ rx->precomp = savepvn(pbuf, rx->prelen);
/* Set up qr// stringification to be equivalent to the supplied
* pattern, this should be done via overload eventually.
* update the regexp struct with the new info.
*/
- buffers = rx->nparens;
-
- Newxz(rx->offs, buffers + 1, regexp_paren_pair);
+ Newxz(rx->offs, rx->nparens + 1, regexp_paren_pair);
return RX;
}
GET_SELF_FROM_PPRIVATE(rx->pprivate);
if (self->cb_exec) {
+ SV *ret;
+
/* Store the current str for ->str */
self->str = (SV*)sv;
SvREFCNT_inc(self->str);
SPAGAIN;
- SV * ret = POPs;
-
+ ret = POPs;
if (SvTRUE(ret))
matched = 1;
else
items = call_sv(callback, G_SCALAR);
if (items == 1) {
- SPAGAIN;
+ SV *ret;
- SV * ret = POPs;
+ SPAGAIN;
+ ret = POPs;
sv_setsv(sv, ret);
} else {
sv_setsv(sv, &PL_sv_undef);
callback = self->cb_num_capture_buff_LENGTH;
if (callback) {
+ IV ret;
+
ENTER;
SAVETMPS;
SPAGAIN;
- IV ret = POPi;
+ ret = POPi;
PUTBACK;
FREETMPS;