cvs: pear /PHP_ParserGenerator package.xml /PHP_ParserGenerator/ParserGenerator Parser.php

From: Date: Fri, 02 Mar 2007 16:36:24 +0000
Subject: cvs: pear /PHP_ParserGenerator package.xml /PHP_ParserGenerator/ParserGenerator Parser.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44933@lists.php.net to get a copy of this message
cellog Fri Mar 2 16:36:24 2007 UTC Modified files: /pear/PHP_ParserGenerator package.xml /pear/PHP_ParserGenerator/ParserGenerator Parser.php Log: - fix Bug #10245: if multiple RHS identifiers are the same, no error http://cvs.php.net/viewvc.cgi/pear/PHP_ParserGenerator/package.xml?r1=1.6&r2=1.7&diff_format=u Index: pear/PHP_ParserGenerator/package.xml diff -u pear/PHP_ParserGenerator/package.xml:1.6 pear/PHP_ParserGenerator/package.xml:1.7 --- pear/PHP_ParserGenerator/package.xml:1.6 Sat Dec 16 04:01:58 2006 +++ pear/PHP_ParserGenerator/package.xml Fri Mar 2 16:36:24 2007 @@ -30,9 +30,9 @@ <email>cellog@php.net</email> <active>yes</active> </lead> - <date>2006-12-15</date> + <date>2007-03-05</date> <version> - <release>0.1.4</release> + <release>0.1.5</release> <api>0.1.0</api> </version> <stability> @@ -41,7 +41,7 @@ </stability> <license uri="http://www.opensource.org/licenses/bsd-license.php">New BSD License</license> <notes> - - fix Bug #9345: help output broken + - fix Bug #10245: if multiple RHS identifiers are the same, no error </notes> <contents> <dir baseinstalldir="PHP" name="/"> @@ -180,5 +180,20 @@ - fix Bug #9345: help output broken </notes> </release> + <release> + <version> + <release>0.1.5</release> + <api>0.1.0</api> + </version> + <stability> + <release>alpha</release> + <api>alpha</api> + </stability> + <date>2007-03-05</date> + <license uri="http://www.opensource.org/licenses/bsd-license.php">New BSD License</license> + <notes> + - fix Bug #10245: if multiple RHS identifiers are the same, no error + </notes> + </release> </changelog> </package> http://cvs.php.net/viewvc.cgi/pear/PHP_ParserGenerator/ParserGenerator/Parser.php?r1=1.1&r2=1.2&diff_format=u Index: pear/PHP_ParserGenerator/ParserGenerator/Parser.php diff -u pear/PHP_ParserGenerator/ParserGenerator/Parser.php:1.1 pear/PHP_ParserGenerator/ParserGenerator/Parser.php:1.2 --- pear/PHP_ParserGenerator/ParserGenerator/Parser.php:1.1 Tue Jul 18 00:53:10 2006 +++ pear/PHP_ParserGenerator/ParserGenerator/Parser.php Fri Mar 2 16:36:24 2007 @@ -18,7 +18,7 @@ * @author Gregory Beaver <cellog@php.net> * @copyright 2006 Gregory Beaver * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @version CVS: $Id: Parser.php,v 1.1 2006/07/18 00:53:10 cellog Exp $ + * @version CVS: $Id: Parser.php,v 1.2 2007/03/02 16:36:24 cellog Exp $ * @since File available since Release 0.1.0 */ /** @@ -536,6 +536,23 @@ $rp->rhs[$i] = $this->rhs[$i]; $rp->rhsalias[$i] = $this->alias[$i]; } + if (count(array_unique($rp->rhsalias)) != count($rp->rhsalias)) { + $used = array(); + foreach ($rp->rhsalias as $i => $symbol) { + if (!is_string($symbol)) { + continue; + } + if (isset($used[$symbol])) { + PHP_ParserGenerator::ErrorMsg($this->filename, + $this->tokenlineno, + "RHS symbol \"%s\" used multiple times.", + $symbol); + $this->errorcnt++; + } else { + $used[$symbol] = $i; + } + } + } $rp->lhs = $this->lhs; $rp->lhsalias = $this->lhsalias; $rp->nrhs = $this->nrhs;

« previous php.pear.cvs (#44933) next »