Skip Menu |

This queue is for tickets about the Regexp-Grammars CPAN distribution.

Report information
The Basics
Id: 75391
Status: open
Priority: 0/
Queue: Regexp-Grammars

People
Owner: Nobody in particular
Requestors: shtil [...] comcast.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Using regex assertions with <
Date: Wed, 29 Feb 2012 00:42:36 +0000 (UTC)
To: bug-regexp-grammars [...] rt.cpan.org
From: shtil [...] comcast.net
Hi, I tried to use a look-behing assertion in a regex with Regexp::Grammars and discovered that the < symbol clashes with Regexp::Grammars syntax: <rule: foo> <pref=((?<!bar)foo)> The module did not like the < inside the sub-pattern. Am I missing something?
Subject: Re: [rt.cpan.org #75391] Using regex assertions with <
Date: Wed, 29 Feb 2012 12:13:28 +1100
To: bug-Regexp-Grammars [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
That's definitely a bug. The workaround for the moment is: <rule: foo> <pref> <token: pref> (?<!bar) foo I'll endeavour to fix it for the next release. Thanks for the report, Damian
Subject: Re: [rt.cpan.org #75391] Using regex assertions with <
Date: Wed, 29 Feb 2012 12:39:20 +1100
To: bug-Regexp-Grammars [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Just uploaded release 1.015, which includes a fix for this bug. Thanks again. Damian
Subject: Re: [rt.cpan.org #75391] Using regex assertions with <
Date: Thu, 1 Mar 2012 17:32:11 +0000 (UTC)
To: bug-Regexp-Grammars [...] rt.cpan.org
From: shtil [...] comcast.net
Thank you very much for the prompt response and resolution. While we are at it, do you think the following is a bug too. my $r1 = q@ <rule: r> <\$> @; my $rg = qr/ <r> $r1 /x; # I get: Eval-group not allowed at runtime, use re 'eval' in regex m/(?{; *Regexp::Grammars::LOGFILE ... No matter what I did I could not get an escaped $ into $rg. Show quoted text
----- Original Message ----- From: "damian@conway.org via RT" <bug-Regexp-Grammars@rt.cpan.org> To: shtil@comcast.net Sent: Tuesday, February 28, 2012 5:40:12 PM Subject: Re: [rt.cpan.org #75391] Using regex assertions with < <URL: https://rt.cpan.org/Ticket/Display.html?id=75391 > Just uploaded release 1.015, which includes a fix for this bug. Thanks again. Damian
Subject: Re: [rt.cpan.org #75391] Using regex assertions with <
Date: Fri, 2 Mar 2012 06:14:10 +1100
To: bug-Regexp-Grammars [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Not a bug. Just standard Perl behaviour. You need to put: use re 'eval'; before the interpolation. Damian
Subject: Re: [rt.cpan.org #75391] Using regex assertions with <
Date: Thu, 1 Mar 2012 20:02:00 +0000 (UTC)
To: bug-Regexp-Grammars [...] rt.cpan.org
From: shtil [...] comcast.net
I see, One more question: Is it possible to fail a rule from an autoaction method? sub method { my ($self, $rhash) = @_; # ... figure out what to do if (MUST_FAIL) { DO_SOMETHING_TO_FAIL } } Show quoted text
----- Original Message ----- From: "damian@conway.org via RT" <bug-Regexp-Grammars@rt.cpan.org> To: shtil@comcast.net Sent: Thursday, March 1, 2012 11:14:59 AM Subject: Re: [rt.cpan.org #75391] Using regex assertions with < <URL: https://rt.cpan.org/Ticket/Display.html?id=75391 > Not a bug. Just standard Perl behaviour. You need to put: use re 'eval'; before the interpolation. Damian
Subject: Re: [rt.cpan.org #75391] Using regex assertions with <
Date: Fri, 2 Mar 2012 07:26:26 +1100
To: bug-Regexp-Grammars [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> One more question: > Is it possible to fail a rule from an autoaction method?
I'm afraid, not. autoactions happen too late (after the rule has finally matched and after its stack frame has been popped). I looked into it, but there's really no way to allow that to work. Sorry, Damian