Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: derhoermi [...] gmx.net
Cc:
AdminCc:

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



CC: bug-text-balanced [...] rt.cpan.org
Subject: Adjacent anonymous subrules misparsed
Date: Thu, 22 Jan 2009 10:47:43 +0100
To: bug-parse-recdescent [...] rt.cpan.org
From: Bjoern Hoehrmann <derhoermi [...] gmx.net>
Hi, With v1.96.0 of Parse::RecDescent and Text::Balanced v2.0.0 the following grammar is not parsed as I would expect: A: ( x x ) ( x x ) This results in 'Untranslatable item encountered: ")"'. This appears to be a logic error in the code around line 1920 starting with ... elsif ($grammar =~ m/(?=$IMPLICITSUBRULE)/gco and do { ($code) = extract_codeblock($grammar,'{([',undef,'(',1); $code }) { $code =~ s/\A\s*\(|\)\Z//g; ... Here $code is '( x x ) ( x x )' and is then turned into 'x x ) ( x x'. I am somewhat unsure from the documentation of Text::Balanced whether it is supposed to return '( x x ) ( x x )' rather than '( x x )', it may be a good idea to document that one way or the other. (By the way, the code passes five parameters to extract_codeblock while it only seems to document four parameters, but then uses them all.) regards, -- Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de 25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Thank you for the bug report! The latest version of Parse::RecDescent and version 2.02 of Text::Balanced appears to correctly parse the provided grammar. As such, I'm resolving this ticket. If you feel this is in error, please feel free to reopen it, and we can discuss why we're seeing different results.