Re: PECL/phpdoc fixed

From: Date: Tue, 18 Dec 2001 05:45:10 +0000
Subject: Re: PECL/phpdoc fixed
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-3527@lists.php.net to get a copy of this message
On Mon, 17 Dec 2001 22:55:10 +0100 jan@kneschke.de wrote: > I got the neccesary permission to apply some fixes to PECL/phpdoc. Now it > compiles with php 4.1.0. Yes so fine :) > Please, check if it still works for you. Yes, only 2 littles things added : - let use variable default as array (i.e like : var $foo = array("bar" => 21); - let use comment inside variable default as : var $foo = array( # 21 because 18 + 3 "bar" => 21 ); Patch was tested and seems works with all 351 files from my current pear tree. --- old_phpdoc.c Tue Dec 18 04:51:26 2001 +++ phpdoc.c Tue Dec 18 04:59:42 2001 @@ -360,16 +360,24 @@ break; case T_ML_COMMENT: case T_COMMENT: - /* Don't know if it's the best way to do it ? */ - if(!strncmp(zendtext, "/**", 3)){ - PHPDOC_STRCAT(new_string, "<phpdoc>"); - sprint_xml(new_string, zendtext); - PHPDOC_STRCAT(new_string, "</phpdoc>\n"); - } else { - PHPDOC_STRCAT(new_string, "<comment>"); - sprint_xml(new_string, zendtext); - PHPDOC_STRCAT(new_string, "</comment>\n"); - } + switch(find_something(st.stack, st.pos)) { + case T_VAR: + PHPDOC_STRCAT(new_string, "></variable>\n"); + st.pos--; + break; + default: + /* Don't know if it's the best way to do it ? */ + if(!strncmp(zendtext, "/**", 3)){ + PHPDOC_STRCAT(new_string, "<phpdoc>"); + sprint_xml(new_string, zendtext); + PHPDOC_STRCAT(new_string, "</phpdoc>\n"); + } else { + PHPDOC_STRCAT(new_string, "<comment>"); + sprint_xml(new_string, zendtext); + PHPDOC_STRCAT(new_string, "</comment>\n"); + } + break; + } break; case T_EXTENDS: switch(find_something(st.stack, st.pos)) { @@ -585,6 +593,11 @@ case T_VAR_DEFAULT: sprint_xml(new_string, zendtext); PHPDOC_STRCAT(new_string, "\""); + st.pos--; + break; + case T_VAR: + zend_sprintf(buffer, "/>"); + PHPDOC_STRCAT(new_string, buffer); st.pos--; break; } HTH :) -- Olivier

« previous php.pear.dev (#3527) next »