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

Report information
The Basics
Id:
48860
Status:
open
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
b2gills [...] gmail.com
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
1.001005
Fixed in:
(no value)



Subject: Simple anonymous array in code block
(?{ $MATCH = [] }) Doesn't work correctly. There is a work-around (?{ $MATCH = [qw''] })
Subject: test

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #48860] Simple anonymous array in code block
Date: Thu, 20 Aug 2009 07:45:41 +0200
To: bug-Regexp-Grammars@rt.cpan.org
From: Damian Conway <damian@conway.org>
Show quoted text
> (?{ $MATCH = [] }) > > Doesn't work correctly.
I can't replicate that. The following example works as expected under 5.10.0 on MacOS. -----cut----------cut----------cut----------cut----------cut----- use Regexp::Grammars; use Data::Dumper 'Dumper'; my $grammar = qr{ <test> <token: test> abc (?{ $MATCH = [] }) }xms; if ('abc' =~ $grammar) { say Dumper \%/; } else { say 'failed'; } -----cut----------cut----------cut----------cut----------cut----- Does it not work for you? Damian
From: Brad Gilbert <b2gills@gmail.com>
#! /usr/bin/env perl use strict; use warnings; use 5.010; use YAML; use Regexp::Grammars; my $str = '[[,action1,,],[action2],[],[,],[,[],]]'; my $parser = qr{ <match=Array> <token: Text> [^,\[\]]* <token: Element> (?: <.Text> | <MATCH=Array> ) <token: Array> \[ (?: (?{ $MATCH = []; }) | <[MATCH=Element]> ** (,) ) \] }x; if( $str =~ $parser ){ say Dump \%/; }else{ die $@ if $@; }
Subject: Re: [rt.cpan.org #48860] Simple anonymous array in code block
Date: Fri, 21 Aug 2009 07:53:48 +0200
To: bug-Regexp-Grammars@rt.cpan.org
From: Damian Conway <damian@conway.org>
Thanks for the example. Definitely a bug. I'm currently tracking the problem down. Damian
Subject: Re: [rt.cpan.org #48860] Simple anonymous array in code block
Date: Fri, 21 Aug 2009 23:01:08 +0200
To: bug-Regexp-Grammars@rt.cpan.org
From: Damian Conway <damian@conway.org>
Bug fixed for the next release. Thanks for the excellent test case that made debugging it so much easier! Damian


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.