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

Re: Perl 5.18 and Regexp::Grammars

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
July 31, 2013 22:07
Subject:
Re: Perl 5.18 and Regexp::Grammars
Message ID:
20130731220654.GF2161@iabyn.com
On Mon, Jul 15, 2013 at 04:57:43PM +0400, Damian Conway wrote:
> Two weeks ago Dave Mitchell wrote:
> 
> > (Please respond to this only when you have the time).
> 
> I now have time. :-)

Sorry, I didn't have time. I have now.

I've started to work my way through your email. I'll reply to specific
points in subsequent emails as a work further along.
> This is the simplest example I could find. It works correctly under 5.14
> (i.e. if prints "DONE", then prints "matched"). Under 5.18 it generates
> a compile-time error:
> 
>     Eval-group not allowed at runtime, use re 'eval' in regex
> 
>         m/ [^#]+ (?{ say 'DONE'; }) /
> 
>     at (eval 1) line 6.

This is actually a more fundamental regression in 5.18.0, that doesn't
require any use of overload etc; just a '#' within a character class in an
extended regex stops code blocks from being parsed:


    $ perl5180 -e'/[#](?{})/x'
    Eval-group not allowed at runtime, use re 'eval' in regex m/[#](?{})/ at -e line 1.
    $ perl5180 -e'use re "eval"; /[#](?{})/x'
    Eval-group not allowed at runtime, use re 'eval' in regex m/[#](?{})/ at (eval 1) line 1.

Fixed now in bleed with c30fc27b4df65a43710b25dd1d2a57d78ee2fe33.
This is a strong candidate for back-porting to maint-5.18.

-- 
Never do today what you can put off till tomorrow.

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