Skip Menu |

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

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

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

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



Subject: Errors in subrule definitions are verbosely ignored
Date: Tue, 6 Apr 2010 23:56:50 +0400
To: bug-Parse-RecDescent [...] rt.cpan.org
From: Evgeniy Zhemchugov <jini.zh [...] gmail.com>
Parse::RecDescent version: Parse-RecDescent-1.965001 Perl version: v5.10.1 (*) built for x86_64-linux Consider the following code defining an incorrect rule: use Parse::RecDescent; Parse::RecDescent->new('a: (.)') || die 'bad grammar'; Its actual output is: ERROR (line 1): Untranslatable item encountered: "." (Hint: Set $::RD_HINT (or -RD_HINT if you're using "perl -s") for hints on fixing these problems.) whereas expected output is: ERROR (line 1): Untranslatable item encountered: "." (Hint: Set $::RD_HINT (or -RD_HINT if you're using "perl -s") for hints on fixing these problems.) bad grammar at -e line 1. The _generate function is supposed to return undef in case of error ($ERRORS != 0). However, in case of implicit rule the function is called recursively and the result of inner invocation is ignored, so the outer instance sees $ERROR == 0 and thinks that grammar is fine. The obvious fix is in the attachement.

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #56331] Errors in subrule definitions are verbosely ignored
Date: Sat, 10 Apr 2010 05:36:50 -0700
To: bug-Parse-RecDescent [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Hi Evgeniy, Many thanks for identifying this serious bug, and for providing the patch to fix it. I've applied it for the next release. All the very best, Damian
Thank you for the bug report! In addition to the behavior Damian added previously, I've added the following text to the "default" $::RD_HINT message ($::RD_HINT undefined): Use $::RD_HINT = 0 to disable this message. You can see the change here: https://github.com/jtbraun/Parse-RecDescent/commit/c5fcc7c3052058be1370fab7541379b9acf014a5 It will be a part of the next release.
I resolved the wrong ticket with the wrong message. The provided test case appears to be behave correctly against the latest release of Parse::RecDescent. So still resolved, but with a different reason. Thank you for the bug report!