diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-03-02 22:00:36 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-03-02 22:32:21 -0700 |
commit | d23b343332abcbc30762e95df57e845e67d5d6b6 (patch) | |
tree | 07a58d19ee9a911b927022d8ac7508b3b1de20ee /regcomp.c | |
parent | c0dc474d564d48073ac6be79c202b48f3fc3c4cf (diff) | |
download | perl-d23b343332abcbc30762e95df57e845e67d5d6b6.tar.gz |
regcomp.c: Remove #if 0 code
This code is obsolete, as new code has been written to do folding;
now that smokes are all passing with that new code, there is no point to
retaining the old.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 98 |
1 files changed, 0 insertions, 98 deletions
@@ -9917,104 +9917,6 @@ parseit: const UV natvalue = NATIVE_TO_UNI(value); nonbitmap = add_range_to_invlist(nonbitmap, prevnatvalue, natvalue); } -#if 0 - - /* If the code point requires utf8 to represent, and we are not - * folding, it can't match unless the target is in utf8. Only - * a few code points above 255 fold to below it, so XXX an - * optimization would be to know which ones and set the flag - * appropriately. */ - ANYOF_FLAGS(ret) |= (FOLD || value < 256) - ? ANYOF_NONBITMAP - : ANYOF_UTF8; - if (prevnatvalue < natvalue) { /* '>' case is fatal error above */ - - /* The \t sets the whole range */ - Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\t%04"UVxf"\n", - prevnatvalue, natvalue); - - /* Currently, we don't look at every value in the range. - * Therefore we have to assume the worst case: that if - * folding, it will match more than one character. But in - * lookbehind patterns, can only be single character - * length, so disallow those folds */ - if (FOLD && ! RExC_in_lookbehind) { - OP(ret) = ANYOFV; - } - } - else if (prevnatvalue == natvalue) { - Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\n", natvalue); - if (FOLD) { - U8 foldbuf[UTF8_MAXBYTES_CASE+1]; - STRLEN foldlen; - const UV f = to_uni_fold(natvalue, foldbuf, &foldlen); - -#ifdef EBCDIC /* RD t/uni/fold ff and 6b */ - if (RExC_precomp[0] == ':' && - RExC_precomp[1] == '[' && - (f == 0xDF || f == 0x92)) { - f = NATIVE_TO_UNI(f); - } -#endif - /* If folding and foldable and a single - * character, insert also the folded version - * to the charclass. */ - if (f != value) { -#ifdef EBCDIC /* RD tunifold ligatures s,t fb05, fb06 */ - if ((RExC_precomp[0] == ':' && - RExC_precomp[1] == '[' && - (f == 0xA2 && - (value == 0xFB05 || value == 0xFB06))) ? - foldlen == ((STRLEN)UNISKIP(f) - 1) : - foldlen == (STRLEN)UNISKIP(f) ) -#else - if (foldlen == (STRLEN)UNISKIP(f)) -#endif - Perl_sv_catpvf(aTHX_ listsv, - "%04"UVxf"\n", f); - else if (! RExC_in_lookbehind) { - /* Any multicharacter foldings - * (disallowed in lookbehind patterns) - * require the following transform: - * [ABCDEF] -> (?:[ABCabcDEFd]|pq|rst) - * where E folds into "pq" and F folds - * into "rst", all other characters - * fold to single characters. We save - * away these multicharacter foldings, - * to be later saved as part of the - * additional "s" data. */ - SV *sv; - - if (!unicode_alternate) - unicode_alternate = newAV(); - sv = newSVpvn_utf8((char*)foldbuf, foldlen, - TRUE); - av_push(unicode_alternate, sv); - OP(ret) = ANYOFV; - } - } - - /* If folding and the value is one of the Greek - * sigmas insert a few more sigmas to make the - * folding rules of the sigmas to work right. - * Note that not all the possible combinations - * are handled here: some of them are handled - * by the standard folding rules, and some of - * them (literal or EXACTF cases) are handled - * during runtime in regexec.c:S_find_byclass(). */ - if (value == UNICODE_GREEK_SMALL_LETTER_FINAL_SIGMA) { - Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\n", - (UV)UNICODE_GREEK_CAPITAL_LETTER_SIGMA); - Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\n", - (UV)UNICODE_GREEK_SMALL_LETTER_SIGMA); - } - else if (value == UNICODE_GREEK_CAPITAL_LETTER_SIGMA) - Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\n", - (UV)UNICODE_GREEK_SMALL_LETTER_SIGMA); - } - } - } -#endif #ifdef EBCDIC literal_endpoint = 0; #endif |