if (!SIZE_ONLY) {
SV *rv = swash_init("utf8", "", listsv, 1, 0);
+#ifdef DEBUGGING
+ AV *av = newAV();
+ av_push(av, rv);
+ av_push(av, listsv);
+ rv = newRV_inc((SV*)av);
+#else
SvREFCNT_dec(listsv);
+#endif
n = add_data(pRExC_state, 1, "s");
RExC_rx->data->data[n] = (void*)rv;
ARG1_SET(ret, flags);
sv_catpv(sv, anyofs[i]);
}
else {
- SV *swash = (SV*)PL_regdata->data[ARG2(o)];
+ SV *rv = (SV*)PL_regdata->data[ARG2(o)];
+ AV *av = (AV*)SvRV((SV*)rv);
+ SV *sw = *av_fetch(av, 0, FALSE);
+ SV *lv = *av_fetch(av, 1, FALSE);
UV i;
U8 s[UTF8_MAXLEN+1];
for (i = 0; i <= 256; i++) { /* just the first 256 */
U8 *e = uv_to_utf8(s, i);
- if (i < 256 && swash_fetch(swash, s)) {
+ if (i < 256 && swash_fetch(sw, s)) {
if (rangestart == -1)
rangestart = i;
} else if (rangestart != -1) {
}
}
sv_catpv(sv, "...");
+ {
+ char *s = savepv(SvPVX(lv));
+
+ while(*s && *s != '\n') s++;
+ if (*s == '\n') {
+ char *t = ++s;
+
+ while (*s) {
+ if (*s == '\n')
+ *s = ' ';
+ s++;
+ }
+ if (s[-1] == ' ')
+ s[-1] = 0;
+
+ sv_catpv(sv, t);
+ }
+ }
}
Perl_sv_catpvf(aTHX_ sv, "%s]", PL_colors[1]);
}
while (--n >= 0) {
switch (r->data->what[n]) {
case 's':
+#ifdef DEBUGGING
+ {
+ SV *rv = (SV*)r->data->data[n];
+ AV *av = (AV*)SvRV((SV*)rv);
+ SV *sw = *av_fetch(av, 0, FALSE);
+ SV *lv = *av_fetch(av, 1, FALSE);
+ SvREFCNT_dec(sw);
+ SvREFCNT_dec(lv);
+ }
+#endif
SvREFCNT_dec((SV*)r->data->data[n]);
break;
case 'f':
*/
#define REGINCLASS(p,c) (ANYOF_FLAGS(p) ? reginclass(p,c) : ANYOF_BITMAP_TEST(p,c))
-#define REGINCLASSUTF8(f,p) (ARG1(f) ? reginclassutf8(f,p) : swash_fetch((SV*)PL_regdata->data[ARG2(f)],p))
+#ifdef DEBUGGING
+# define REGINCLASSUTF8(f,p) (ARG1(f) ? reginclassutf8(f,p) : swash_fetch(*av_fetch((AV*)SvRV((SV*)PL_regdata->data[ARG2(f)]),0,FALSE),p))
+#else
+# define REGINCLASSUTF8(f,p) (ARG1(f) ? reginclassutf8(f,p) : swash_fetch((SV*)PL_regdata->data[ARG2(f)],p))
+#endif
#define CHR_SVLEN(sv) (UTF ? sv_len_utf8(sv) : SvCUR(sv))
#define CHR_DIST(a,b) (UTF ? utf8_distance(a,b) : a - b)
dTHR;
char flags = ARG1(f);
bool match = FALSE;
- SV *sv = (SV*)PL_regdata->data[ARG2(f)];
+#ifdef DEBUGGING
+ SV *rv = (SV*)PL_regdata->data[ARG2(f)];
+ AV *av = (AV*)SvRV((SV*)rv);
+ SV *sw = *av_fetch(av, 0, FALSE);
+ SV *lv = *av_fetch(av, 1, FALSE);
+#else
+ SV *sw = (SV*)PL_regdata->data[ARG2(f)];
+#endif
- if (swash_fetch(sv, p))
+ if (swash_fetch(sw, p))
match = TRUE;
else if (flags & ANYOF_FOLD) {
U8 tmpbuf[UTF8_MAXLEN+1];
}
else
uv_to_utf8(tmpbuf, toLOWER_utf8(p));
- if (swash_fetch(sv, tmpbuf))
+ if (swash_fetch(sw, tmpbuf))
match = TRUE;
}