Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.1.7

Bug #11647 substitution of @X works incorrectly
Submitted: 2007-07-19 19:24 UTC
From: r0vert Assigned: r0vert
Status: Assigned Package: PHP_ParserGenerator (version CVS)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2007-07-19 19:24 UTC] r0vert (Trevor Sluis)
Description: ------------ If using @X for the code of a rule it should be use the token number instead of the token value. Test script: --------------- match ::= TYPE(A) TEXT(T). { doSomething(@X, T) } Expected result: ---------------- doSomething($this->yystack[$this->yyidx + -1]->major, $this->yystack[$this->yyidx + 0]->minor) Actual result: -------------- doSomething($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor)

Comments

 [2007-07-19 19:24 UTC] r0vert (Trevor Sluis)
[Patch] ParserGenerator/Data.php @@ -1733,7 +1733,7 @@ } else { for ($ii = 0; $ii < $rp->nrhs; $ii++) { if ($rp->rhsalias[$ii] && $tempcp == $rp->rhsalias[$ii]) { - if ($ii !== 0 && $rp->code[$ii - 1] == '@') { + if ($rp->code[$i - 1] == '@') {
 [2007-08-18 23:11 UTC] cellog (Greg Beaver)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2007-08-20 14:08 UTC] cellog (Greg Beaver)
I applied the patch incorrectly, re-opening as a reminder (used $rp->code[0] instead of $rp->code[$i - 1])