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

Re: [perl #92898] (*THEN) broken inside condition subpattern

Thread Previous | Thread Next
From:
demerphq
Date:
June 23, 2013 12:22
Subject:
Re: [perl #92898] (*THEN) broken inside condition subpattern
Message ID:
CANgJU+XwNhPOgajiSMUUzDXkmo880aLuh9hS2TTcE0Hz2w-8Dw@mail.gmail.com
On 23 June 2013 13:18,  <ph10@hermes.cam.ac.uk> wrote:
> On Sat, 22 Jun 2013, demerphq wrote:
>
>> Sorry about the incredibly laggy reply. :-(
>
> Hi Yves,
>
> No problem; glad somebody has picked this up. For myself, I can no
> longer remember exactly what I was complaining about!

FC pointed out a list of VERB issues and I am trying to work through
them and decide if they are buggy, or ambiguous or whatnot.

Definitely some of things that have been reported have been bugs. A
few have been interpretation issues.

>> I think you are right that perl thinks differently to you. Probably
>> because of implementation details.
>
> Thanks for taking the time to give a long explanation of the way Perl
> works, which indeed is different to the way PCRE works - and of course
> it's far too late to change that now.

Indeed. Both projects have a very long history and some things are
difficult to change.

> In a recent release of PCRE we have formulated some reasonably
> consistent rules for way that backtracking verbs are handled, and
> documented them. In many cases the behaviour is the same as Perl's, but
> there are some differences.

Id like to hear about the differences. This thread makes me wonder how
many are due to bugs in how the various optimizations interact and how
many are due to other issues.

>> Anyway, I can see how it would be reasonable to consider (?:foo) to be
>> an alternation with only one branch, but to Perl it isnt, and that is
>> how you should interpret the verb operators.
>
> PCRE does now get this (perhaps not 100%, but to some extent) "right" in
> its current treatment of (*THEN). The documentation even says this: "A
> subpattern that does not contain a | character is just a part of the
> enclosing alternative; it is not a nested alternation with only one
> alternative."

Cool. I will try to find time to read the PCRE docs and look for
discrepancies and investigate.

Cheers,
Yves


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

Thread Previous | 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