develooper Front page | perl.perl5.porters | Postings from March 2013

split patches working now, but it revealed a problem in the regex compilation

Thread Next
From:
demerphq
Date:
March 26, 2013 09:35
Subject:
split patches working now, but it revealed a problem in the regex compilation
Message ID:
CANgJU+UD2cjn6d_uVeqBwXskDm=m_8MYgTh62VL-9iZ7pybuaw@mail.gmail.com
I have pushed a new yves/revert_splitwhite branch.

It passes all tests except for some which now fail in re/recompile.t

As far as I can tell these failures come from a change I did to fix
the problem that the caching logic was using the precompiled string
(meaning without "(?...:....)" wrapper) and not checking that the
compiled pattern and the uncompiled had the same regex flags.

I noticed this testing the behavior of

split $_ ? / / : ' ', $string for 1,0,1,0

which would not recompile due to the two patterns differing only by flags.

My fix is apparently overly pessimistic, and causes perl to recompile
things like "\x{100}" more often than we should. This is because the
patterns starts off as utf8-off, but ends up as a utf8-on.

At worst this means we recompile utf8 patterns more often.

Anyway, before I TODO the failing tests I thought I should let Dave M
know and see if he can come up with something.

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About