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

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

Thread Next
Karl Williamson
October 25, 2015 03:05
Include \s{wb} \s{sb} fixes in 5.22.1?
Message ID:
This ticket
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 

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

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

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About