Skip Menu |

This queue is for tickets about the Parse-RecDescent CPAN distribution.

Report information
The Basics
Id: 4900
Status: resolved
Priority: 0/
Queue: Parse-RecDescent

People
Owner: Nobody in particular
Requestors: mezam [...] mezami.qc.ca
Cc:
AdminCc:

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



Subject: $return should not cause the current production to succeed
The documentation say: Note that setting $return doesn't cause the current production to succeed. It merely tells it what to return if it does succeed. But: use Parse::RecDescent; my $parser = new Parse::RecDescent( q[ rule: 'a' { $return = 1;} 'b' ]); print $parser->rule("a z"); #should print nothing but print 1
use Test::More qw( no_plan); use Parse::RecDescent; my $parser = new Parse::RecDescent( q[ do_not_match: 'a' { $return = 3;} 'z' ]); isa_ok( $parser, 'Parse::RecDescent', '$parser'); is( $parser->do_not_match("a b"), undef, '$return doesn\'t cause the current production to succeed');
Date: Mon, 26 Jan 2004 15:57:20 +1100
From: Damian Conway <damian [...] conway.org>
To: bug-Parse-RecDescent [...] rt.cpan.org
Subject: Re: [cpan #4900] $return should not cause the current production to succeed
RT-Send-Cc:
Guest via RT wrote: Show quoted text
> This message about Parse-RecDescent was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=4900 > > > The documentation say: > > Note that setting $return doesn't cause the current production > to succeed. It merely tells it what to return if it does succeed. > > But: > use Parse::RecDescent; > > my $parser = new Parse::RecDescent( q[ > rule: 'a' { $return = 1;} 'b' > ]); > > print $parser->rule("a z"); #should print nothing but print 1
Fixed for the next release. Thanks. Damian
According to the ticket history this has been addressed, and appears to be fixed in the current release. Thank you for the bug report!