develooper Front page | perl.perl5.porters | Postings from October 2015

Include \s{wb} \s{sb} fixes in 5.22.1?

Thread Next
From:
Karl Williamson
Date:
October 25, 2015 03:05
Subject:
Include \s{wb} \s{sb} fixes in 5.22.1?
Message ID:
562C46F0.3080807@khwilliamson.com
This ticket
https://rt.perl.org/Ticket/Display.html?id=126319
led me to find several bugs in the implementation of the new-in-5.22 
\b{wb} and \b{sb} features.

Some of this is from an incomplete definition from Unicode in their 
algorithms for this, in that when matched against an empty string there 
really shouldn't be a break, which they don't specify.  And some were 
mistakes I made in the implementation, that, in spite of them, passed 
Unicode's apparently extensive test suite (which doesn't include an 
empty string).  It turns out that there were multiple bugs which were 
almost completely offsetting, but also most of their suite just does 
pair-wise tests, and some of my bugs were from not keeping proper track 
as one went through a longer string.

About the time 5.22.0 shipped, rjbs noticed that \b{sb} wasn't giving 
him expected results; it was in fact giving him very wrong ones.  Both 
of us being busy with YAPC:NA at the time, we attributed this to a 
Unicode algorithm issue, and deferred addressing it.  But now, these 
fixes turn out to fix his issues.

The bottom line is that 5.22.0 has some bugs with \b{wb} and \b{sb}, 
rendering the latter mostly useless.  Most of the remaining problems are 
actually with the \B{} forms, except the incorrect matching of the empty 
string.

We have a chance to fix this in 5.22.1.  I'm voting for an exception to 
be made to the rules, to allow these fixes to go in.  I think it best to 
get \b{sb} sane before people decide it's worthless and avoid it in the 
future.  rjbs has indicated that he could be convinced to allow this 
exception, based on feedback to this message.

The fixes are the merge commit f0bd363c36d925d8d3dfe3b68715763c850b171a
which includes the commits from
da271c5413343d25ab18d217cdc225c0be1633d9
through
139a998acd6eae73587ff4f048925394f73682d9

Also, commit 7195e5da55a40d15e29ad80562668bdd6895441f adds a test for 
one of the problems rjbs saw

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