cvs: pear /PECL/phpdoc phpdoc.c

From: Date: Wed, 26 Dec 2001 10:33:02 +0000
Subject: cvs: pear /PECL/phpdoc phpdoc.c
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1697@lists.php.net to get a copy of this message
ostborn Wed Dec 26 05:33:02 2001 EDT Modified files: /pear/PECL/phpdoc phpdoc.c Log: Patch from Olivier Courtin > - 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 > ); Index: pear/PECL/phpdoc/phpdoc.c diff -u pear/PECL/phpdoc/phpdoc.c:1.4 pear/PECL/phpdoc/phpdoc.c:1.5 --- pear/PECL/phpdoc/phpdoc.c:1.4 Tue Dec 18 14:58:58 2001 +++ pear/PECL/phpdoc/phpdoc.c Wed Dec 26 05:33:02 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phpdoc.c,v 1.4 2001/12/18 19:58:58 andrei Exp $ */ +/* $Id: phpdoc.c,v 1.5 2001/12/26 10:33:02 ostborn Exp $ */ #include "php.h" #include "php_ini.h" @@ -351,16 +351,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)) { @@ -576,6 +584,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; }

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