From: Jarkko Hietaniemi Date: Sun, 26 Nov 2000 23:36:02 +0000 (+0000) Subject: Debug dump of ANYOFUTF8 was garbage (data from ANYOF). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=847a199f22a566ad84276d7dcfe856f0ce7877b8;p=p5sagit%2Fp5-mst-13.2.git Debug dump of ANYOFUTF8 was garbage (data from ANYOF). Not really fixed (should really dump the UTF-8 charclass), but stopped displaying the garbage. Also add a note on the (missing) Unicode PSXSPC and BLANK. p4raw-id: //depot/perl@7874 --- diff --git a/regcomp.c b/regcomp.c index 989ca24..46a0bb6 100644 --- a/regcomp.c +++ b/regcomp.c @@ -3876,6 +3876,9 @@ S_regclassutf8(pTHX_ RExC_state_t *pRExC_state) case ANYOF_SPACE: case ANYOF_PSXSPC: case ANYOF_BLANK: + /* Not very true for PSXSPC and BLANK + * but not feeling like creating IsPOSIXSpace and + * IsBlank right now. --jhi */ Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsSpace\n"); break; case ANYOF_NSPACE: case ANYOF_NPSXSPC: @@ -4374,26 +4377,31 @@ Perl_regprop(pTHX_ SV *sv, regnode *o) Perl_sv_catpvf(aTHX_ sv, "[%s", PL_colors[0]); if (o->flags & ANYOF_INVERT) sv_catpv(sv, "^"); - for (i = 0; i <= 256; i++) { - if (i < 256 && ANYOF_BITMAP_TEST(o,i)) { - if (rangestart == -1) - rangestart = i; - } else if (rangestart != -1) { - if (i <= rangestart + 3) - for (; rangestart < i; rangestart++) + if (OP(o) == ANYOF) { + for (i = 0; i <= 256; i++) { + if (i < 256 && ANYOF_BITMAP_TEST(o,i)) { + if (rangestart == -1) + rangestart = i; + } else if (rangestart != -1) { + if (i <= rangestart + 3) + for (; rangestart < i; rangestart++) + put_byte(sv, rangestart); + else { put_byte(sv, rangestart); - else { - put_byte(sv, rangestart); - sv_catpv(sv, "-"); - put_byte(sv, i - 1); + sv_catpv(sv, "-"); + put_byte(sv, i - 1); + } + rangestart = -1; } - rangestart = -1; } + if (o->flags & ANYOF_CLASS) + for (i = 0; i < sizeof(out)/sizeof(char*); i++) + if (ANYOF_CLASS_TEST(o,i)) + sv_catpv(sv, out[i]); + } + else { + sv_catpv(sv, "{ANYOFUTF8}"); /* TODO: full decode */ } - if (o->flags & ANYOF_CLASS) - for (i = 0; i < sizeof(out)/sizeof(char*); i++) - if (ANYOF_CLASS_TEST(o,i)) - sv_catpv(sv, out[i]); Perl_sv_catpvf(aTHX_ sv, "%s]", PL_colors[1]); } else if (k == BRANCHJ && (OP(o) == UNLESSM || OP(o) == IFMATCH))