cvs: pear /PhpDocumentor package.xml package2.xml /PhpDocumentor/phpDocumentor Parser.inc ParserElements.inc phpDocumentorTParser.inc
/PhpDocumentor/scripts create_package.xml.php

From: Date: Thu, 23 Feb 2006 05:48:31 +0000
Subject: cvs: pear /PhpDocumentor package.xml package2.xml /PhpDocumentor/phpDocumentor Parser.inc ParserElements.inc phpDocumentorTParser.inc
/PhpDocumentor/scripts create_package.xml.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38526@lists.php.net to get a copy of this message
cellog Thu Feb 23 05:48:31 2006 UTC Modified files: /pear/PhpDocumentor package.xml package2.xml /pear/PhpDocumentor/phpDocumentor Parser.inc ParserElements.inc phpDocumentorTParser.inc /pear/PhpDocumentor/scripts create_package.xml.php Log: fix Bug #6305: array typehints break the parser

http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/package.xml?r1=1.12&r2=1.13&diff_format=u Index: pear/PhpDocumentor/package.xml diff -u pear/PhpDocumentor/package.xml:1.12 pear/PhpDocumentor/package.xml:1.13 --- pear/PhpDocumentor/package.xml:1.12 Wed Feb 22 23:02:04 2006 +++ pear/PhpDocumentor/package.xml Thu Feb 23 05:48:29 2006 @@ -152,6 +152,7 @@ - fixed these bugs reported in PEAR: Bug #2288: Webfrontend ignores more than one dir in &quot;Files to ignore&quot; Bug #5011: PDF generation warning on uksort + Bug #6305: array typehints break the parser </notes> <deps> <dep type="php" rel="ge" version="4.1.0" optional="no"/> @@ -2434,6 +2435,7 @@ - fixed these bugs reported in PEAR: Bug #2288: Webfrontend ignores more than one dir in &quot;Files to ignore&quot; Bug #5011: PDF generation warning on uksort + Bug #6305: array typehints break the parser </notes> </release> </changelog> http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/package2.xml?r1=1.3&r2=1.4&diff_format=u Index: pear/PhpDocumentor/package2.xml diff -u pear/PhpDocumentor/package2.xml:1.3 pear/PhpDocumentor/package2.xml:1.4 --- pear/PhpDocumentor/package2.xml:1.3 Wed Feb 22 23:02:04 2006 +++ pear/PhpDocumentor/package2.xml Thu Feb 23 05:48:29 2006 @@ -64,7 +64,7 @@ <active>yes</active> </developer> <date>2006-02-22</date> - <time>16:33:35</time> + <time>23:47:08</time> <version> <release>1.3.0RC6</release> <api>1.3.0</api> @@ -155,6 +155,7 @@ - fixed these bugs reported in PEAR: Bug #2288: Webfrontend ignores more than one dir in &quot;Files to ignore&quot; Bug #5011: PDF generation warning on uksort + Bug #6305: array typehints break the parser </notes> <contents> <dir baseinstalldir="PhpDocumentor" name="/"> @@ -1585,6 +1586,11 @@ <channel>pear.php.net</channel> <min>1.1</min> </package> + <package> + <name>XML_Beautifier</name> + <channel>pear.php.net</channel> + <min>1.1</min> + </package> </optional> </dependencies> <phprelease> @@ -2609,6 +2615,7 @@ - fixed these bugs reported in PEAR: Bug #2288: Webfrontend ignores more than one dir in &quot;Files to ignore&quot; Bug #5011: PDF generation warning on uksort + Bug #6305: array typehints break the parser </notes> </release> </changelog> http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/phpDocumentor/Parser.inc?r1=1.1&r2=1.2&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/Parser.inc diff -u pear/PhpDocumentor/phpDocumentor/Parser.inc:1.1 pear/PhpDocumentor/phpDocumentor/Parser.inc:1.2 --- pear/PhpDocumentor/phpDocumentor/Parser.inc:1.1 Mon Oct 17 18:36:56 2005 +++ pear/PhpDocumentor/phpDocumentor/Parser.inc Thu Feb 23 05:48:30 2006 @@ -283,6 +283,11 @@ /** currently parsing a comment in a variable array value */ define("STATE_VAR_ARRAY_COMMENT" , 243); +/** used when a $param is encountered in a function definition */ +define("PARSER_EVENT_FUNCTION_PARAM_VAR", 144); +/** currently parsing a $param in a function definition */ +define("STATE_FUNCTION_PARAM_VAR", 244); + if (!defined('T_INTERFACE')) { define('T_INTERFACE', 'foo'); @@ -306,7 +311,7 @@ * This parser is slower than the tokenizer-based parser, and is deprecated. * @author Joshua Eichorn <jeichorn@phpdoc.org> * @author Gregory Beaver <cellog@users.sourceforge.net> - * @version $Id: Parser.inc,v 1.1 2005/10/17 18:36:56 jeichorn Exp $ + * @version $Id: Parser.inc,v 1.2 2006/02/23 05:48:30 cellog Exp $ * @package phpDocumentor * @subpackage Parsers * @deprecated in favor of {@link phpDocumentorTParser} http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/phpDocumentor/ParserElements.inc?r1=1.2&r2=1.3&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/ParserElements.inc diff -u pear/PhpDocumentor/phpDocumentor/ParserElements.inc:1.2 pear/PhpDocumentor/phpDocumentor/ParserElements.inc:1.3 --- pear/PhpDocumentor/phpDocumentor/ParserElements.inc:1.2 Mon Nov 28 07:27:59 2005 +++ pear/PhpDocumentor/phpDocumentor/ParserElements.inc Thu Feb 23 05:48:30 2006 @@ -22,7 +22,7 @@ * @package phpDocumentor * @subpackage ParserElements * @since 1.1 - * @version $Id: ParserElements.inc,v 1.2 2005/11/28 07:27:59 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ */ /** @@ -32,7 +32,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.2 2005/11/28 07:27:59 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ */ class parserElement extends parserBase { @@ -185,7 +185,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.2 2005/11/28 07:27:59 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ */ class parserInclude extends parserElement { @@ -201,7 +201,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.1 - * @version $Id: ParserElements.inc,v 1.2 2005/11/28 07:27:59 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ */ class parserGlobal extends parserElement { @@ -304,7 +304,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.2 2005/11/28 07:27:59 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ */ class parserFunction extends parserElement { @@ -344,14 +344,20 @@ var $statics = false; var $source = ''; + /** * @param string * @param string default value parsed from function definition * @param boolean indicates whether this parameter has a default value + * @param null|string class type hint */ - function addParam($name, $value, $has_default = true) + function addParam($name, $value, $has_default = true, $typehint = null) { $this->params[$name] = array($value, $has_default); + if (isset($typehint)) + { + $this->params[$name][2] = $typehint; + } } /** @@ -653,7 +659,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.2 2005/11/28 07:27:59 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ */ class parserClass extends parserElement { @@ -1249,7 +1255,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.2 2005/11/28 07:27:59 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ */ class parserVar extends parserElement { @@ -1426,7 +1432,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.2 2005/11/28 07:27:59 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ */ class parserMethod extends parserFunction { @@ -1610,7 +1616,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.2 2005/11/28 07:27:59 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ */ class parserDefine extends parserElement { @@ -1654,7 +1660,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@users.sourceforge.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.2 2005/11/28 07:27:59 cellog Exp $ + * @version $Id: ParserElements.inc,v 1.3 2006/02/23 05:48:30 cellog Exp $ */ class parserPackagePage extends parserStringWithInlineTags { http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/phpDocumentor/phpDocumentorTParser.inc?r1=1.2&r2=1.3&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/phpDocumentorTParser.inc diff -u pear/PhpDocumentor/phpDocumentor/phpDocumentorTParser.inc:1.2 pear/PhpDocumentor/phpDocumentor/phpDocumentorTParser.inc:1.3 --- pear/PhpDocumentor/phpDocumentor/phpDocumentorTParser.inc:1.2 Sun Nov 20 21:04:09 2005 +++ pear/PhpDocumentor/phpDocumentor/phpDocumentorTParser.inc Thu Feb 23 05:48:30 2006 @@ -21,14 +21,14 @@ * @package phpDocumentor * @subpackage Parsers * @author Gregory Beaver <cellog@users.sourceforge.net> - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ /** * Tokenizer-based parser for PHP source code * @package phpDocumentor * @subpackage Parsers * @author Gregory Beaver <cellog@users.sourceforge.net> - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ class phpDocumentorTParser extends Parser { @@ -138,6 +138,7 @@ PARSER_EVENT_EOFQUOTE => 'handleHereDoc', PARSER_EVENT_FUNCTION => 'handleFunction', PARSER_EVENT_FUNCTION_PARAMS => 'handleFunctionParams', + PARSER_EVENT_FUNCTION_PARAM_VAR => 'handleFunctionParams', PARSER_EVENT_FUNC_GLOBAL => 'handleFuncGlobal', PARSER_EVENT_DEFINE_GLOBAL => 'handleGlobal', PARSER_EVENT_GLOBAL_VALUE => 'handleGlobalValue', @@ -549,23 +550,24 @@ function handleFunctionParams($word, $pevent) { - //echo $this->wp->getPos() . ": word=|$word|\t\t\tlastword=|".$this->_pv_last_word."|\n"; + //echo $this->_wp->getPos() . ": word=|$word|\t\t\tlastword=|".$this->_pv_last_word."|\n"; //echo "function_param = '".$this->_pv_function_param."'\n"; //echo "function_data = '".$this->_pv_function_data."'\n"; - $e1 = $this->checkEventPush( $word, $pevent); + $e1 = $this->checkEventPush($word, $pevent); if (!$e1) { - if ($word == ',' || $this->checkEventPop($word,$pevent)) - { + if ($this->checkEventPop($word,$pevent) && $pevent == PARSER_EVENT_FUNCTION_PARAM_VAR) + { // end of [typehint ]$param[= defaultval] + $this->_wp->backupPos(); $this->endFunctionParam($word); } elseif ($word == '=') - { + { // about to parse the default value $this->_pf_funcparam_val = true; } else { if ($this->_pf_funcparam_val) - { + { // parsing default value if (isset($this->_pv_quote_data)) { $this->_pv_function_data .= $this->_pv_quote_data; @@ -574,12 +576,12 @@ if (is_array($word)) $word = $word[1]; $this->_pv_function_data .= $word; } else - { + { // pre-param if (!isset($this->_pv_function_param)) $this->_pv_function_param = ''; - if (is_array($word)) + if (is_array($word) && $pevent == PARSER_EVENT_FUNCTION_PARAMS) { - if ($word[0] == T_STRING) - { + if ($word[0] == T_STRING || $word[0] == T_ARRAY) + { // object or array type hint $this->_pv_function_param_type = $word[1]; return; } @@ -591,6 +593,9 @@ } elseif ($e1 == PARSER_EVENT_ARRAY) { $this->_wp->setWhiteSpace(true); + } elseif ($e1 == PARSER_EVENT_FUNCTION_PARAM_VAR) { + // we just got the $var part of the param + $this->_pv_function_param .= $word[1]; } } @@ -2396,17 +2401,26 @@ $this->tokenpushEvent[PARSER_EVENT_FUNCTION_PARAMS] = array( + T_VARIABLE => PARSER_EVENT_FUNCTION_PARAM_VAR, + T_COMMENT => PARSER_EVENT_COMMENT, + T_DOC_COMMENT => PARSER_EVENT_COMMENT, + ); + $this->wordpopEvent[PARSER_EVENT_FUNCTION_PARAMS] = array(")"); +/**************************************************************/ + + $this->tokenpushEvent[PARSER_EVENT_FUNCTION_PARAM_VAR] = + array( T_CONSTANT_ENCAPSED_STRING => PARSER_EVENT_QUOTE, - T_ARRAY => PARSER_EVENT_ARRAY, T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_COMMENT, + T_ARRAY => PARSER_EVENT_ARRAY, ); - $this->wordpushEvent[PARSER_EVENT_FUNCTION_PARAMS] = + $this->wordpushEvent[PARSER_EVENT_FUNCTION_PARAM_VAR] = array( '"' => PARSER_EVENT_QUOTE, "'" => PARSER_EVENT_QUOTE, ); - $this->wordpopEvent[PARSER_EVENT_FUNCTION_PARAMS] = array(")"); + $this->wordpopEvent[PARSER_EVENT_FUNCTION_PARAM_VAR] = array(",", ")"); /**************************************************************/ $this->tokenpushEvent[PARSER_EVENT_ARRAY] = http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/scripts/create_package.xml.php?r1=1.12&r2=1.13&diff_format=u Index: pear/PhpDocumentor/scripts/create_package.xml.php diff -u pear/PhpDocumentor/scripts/create_package.xml.php:1.12 pear/PhpDocumentor/scripts/create_package.xml.php:1.13 --- pear/PhpDocumentor/scripts/create_package.xml.php:1.12 Wed Feb 22 23:03:53 2006 +++ pear/PhpDocumentor/scripts/create_package.xml.php Thu Feb 23 05:48:30 2006 @@ -87,6 +87,7 @@ - fixed these bugs reported in PEAR: Bug #2288: Webfrontend ignores more than one dir in "Files to ignore" Bug #5011: PDF generation warning on uksort + Bug #6305: array typehints break the parser '; $version = '1.3.0RC6'; $options = array( @@ -103,23 +104,6 @@ 'docbuilder' => 'data', 'HTML_TreeMenu-1.1.2' => 'data', 'tutorials' => 'doc', - 'phpDocumentor/Converters/CHM/default/templates/default/templates_c' => 'data', - 'phpDocumentor/Converters/PDF/default/templates/default/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/frames/templates/default/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/frames/templates/l0l33t/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/frames/templates/phpdoc.de/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/frames/templates/phphtmllib/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/frames/templates/phpedit/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/frames/templates/earthli/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/frames/templates/DOM/default/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/frames/templates/DOM/l0l33t/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/frames/templates/DOM/phpdoc.de/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/frames/templates/DOM/phphtmllib/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/frames/templates/DOM/earthli/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/Smarty/templates/default/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/Smarty/templates/PHP/templates_c' => 'data', - 'phpDocumentor/Converters/HTML/Smarty/templates/HandS/templates_c' => 'data', - 'phpDocumentor/Converters/XML/DocBook/peardoc2/templates/default/templates_c' => 'data', ), 'simpleoutput' => true, 'exceptions' => @@ -161,7 +145,6 @@ '*CSV*', 'makedocs.ini', 'publicweb-PEAR-1.2.1.patch.txt', - '*templates_c*' ), 'installexceptions' => array('pear-phpdoc' => '/', 'pear-phpdoc.bat' => '/', 'scripts/makedoc.sh' => '/'), );
« previous php.pear.cvs (#38526) next »