diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-26 23:36:02 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-26 23:36:02 +0000 |
commit | 847a199f22a566ad84276d7dcfe856f0ce7877b8 (patch) | |
tree | 2ed0e52a1f0aac42a27bf8c8275583f457fc45c0 /regcomp.c | |
parent | 667bb95a2be204307d06062e22190a222414f7ae (diff) | |
download | perl-847a199f22a566ad84276d7dcfe856f0ce7877b8.tar.gz |
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
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 40 |
1 files changed, 24 insertions, 16 deletions
@@ -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)) |