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

Re: [perl #116639] regex optimiser wrongly rejects certain matchesinvolving embedded comments

Thread Previous | Thread Next
From:
Karl Williamson
Date:
October 18, 2015 04:17
Subject:
Re: [perl #116639] regex optimiser wrongly rejects certain matchesinvolving embedded comments
Message ID:
56231D2C.7010706@khwilliamson.com
On 10/17/2015 07:53 PM, Ricardo Signes wrote:
> * Abigail <abigail@abigail.be> [2015-10-14T07:43:05]
>> On Tue, Oct 13, 2015 at 03:42:29PM -0700, Karl Williamson via RT wrote:
>>>
>>> My only stance on this is that I think (but am convince-able the other
>>> way) that under /x, anywhere there is a # comment, should also allow a
>>> (?#...) comment
>>
>> I agree. And I'd throw whitespace in it as well: anywhere where we
>> ignore whitespace under /x, we should allow a # comment, and hence,
>> should allow a (?#...) comment.
>
> I wish I'd read your testing out of this before going through and doing it
> myself. :-)
>
> Anyway, I agree.  While I'd rather nobody actually write this, I think that's a
> matter of style.  Anyway: making it a matter of grammar would require either
> weird inconsistency or breakage.
>

Just to make sure everyone understands.

Currently (?#...) comments are allowed even when there is no /x.  We 
probably have to support that in the places where it's been that way all 
along, but we could decide to not support them in the places that I just 
added, when not under /x.  Thus, we could say that you can't split a 
quantifier from its atom except under /x.

I don't have an opinion on this.

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