From: Yves Orton Date: Wed, 2 Sep 2009 15:37:48 +0000 (+0200) Subject: set PERL_LEGACY_UNICODE_CHARCLASS_MAPPINGS to 0 and enable proper POSIX char class... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ba9ac1759cb6e7a5e6883c85edd0b450061b5ccb;p=p5sagit%2Fp5-mst-13.2.git set PERL_LEGACY_UNICODE_CHARCLASS_MAPPINGS to 0 and enable proper POSIX char class matching This also alters which Unicode properties that the POSIX character class and the Perl "special" character classes, like \w and \d map to. At the same time it allows a number of tests for POSIX character class behaviour to be switched from todo to non todo. Legacy testing is still available by changing the define and setting the PERL_TEST_LEGACY_POSIX_CC value to true. --- diff --git a/regcomp.h b/regcomp.h index 2ac1be1..cd6a71a 100644 --- a/regcomp.h +++ b/regcomp.h @@ -31,10 +31,11 @@ typedef OP OP_4tree; /* Will be redefined later. */ * * Personally I think 5.12 should disable this for sure. Its a bit more debatable for * 5.10, so for now im leaving it enabled. + * XXX: It is now enabled for 5.11/5.12 * * -demerphq */ -#define PERL_LEGACY_UNICODE_CHARCLASS_MAPPINGS 1 +#define PERL_LEGACY_UNICODE_CHARCLASS_MAPPINGS 0 /* Should the optimiser take positive assertions into account? */ #define PERL_ENABLE_POSITIVE_ASSERTION_STUDY 0 diff --git a/t/op/pat.t b/t/op/pat.t index 00c5490..c610a6a 100644 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -2061,11 +2061,11 @@ sub run_tests { local $Message = "No SEGV in s/// and UTF-8"; my $s = "s#\x{100}" x 4; ok $s =~ s/[^\w]/ /g; - if ($ENV {REAL_POSIX_CC}) { - iseq $s, "s " x 4; + if ( $ENV{PERL_TEST_LEGACY_POSIX_CC} ) { + iseq $s, "s \x{100}" x 4; } else { - iseq $s, "s \x{100}" x 4; + iseq $s, "s " x 4; } } @@ -4012,7 +4012,7 @@ sub run_tests { }; skip "Eval failed ($@)", 1 if $@; skip "PERL_LEGACY_UNICODE_CHARCLASS_MAPPINGS set to 0", 1 - if $ENV {REAL_POSIX_CC}; + if !$ENV{PERL_TEST_LEGACY_POSIX_CC}; iseq join ('', @isPunctLatin1), '', 'IsPunct agrees with [:punct:] with explicit Latin1'; } diff --git a/t/op/re_tests b/t/op/re_tests index 10bee20..b9177e9 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -1387,7 +1387,7 @@ foo(\h)bar foo\tbar y $1 \t # [perl #60344] Regex lookbehind failure after an (if)then|else in perl 5.10 /\A(?(?=db2)db2|\D+)(?