Re: Doc comment patch
| From: | (Marcus Börger) | Date: | Thu, 13 Mar 2003 21:01:50 +0000 |
| Subject: | Re: Doc comment patch | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-33@lists.php.net to get a copy of this message | ||
At 21:51 13.03.2003, Andrei Zmievski wrote:
Pursuant to the introspection portion of TODO-PHP5, here is a small patch that: - Keeps track of starting/ending line numbers for user functions. - Removes extraneous T_ML_COMMENT token. - Stores the last seen doc comment (JavaDoc style) in the compiler globals for future access by the introspection features and introduces the new T_DOC_COMMENT token. The doc comment is defined as a multiline comment starting with "/** \n" and ending with "*/". So, in the following example: /** * @name foo * @param blah string */ function foo($blah) { } The CG(doc_comment) will contain: * @name foo * @param blah string What is left to do here is adding the T_DOC_COMMENT to parser rules and storing it in the appropriate structures (zend_op_array for functions, zend_class_entry for classes, etc). If no one objects, I will commit it shortly.Great! Some questions: 1) Will you allow compatibility with doxygen by this: +<ST_IN_SCRIPTING>"/** "{NEWLINE} {
+ CG(comment_start_line) = CG(zend_lineno); + BEGIN(ST_DOC_COMMENT); + yymore();+} + changed to: +<ST_IN_SCRIPTING>("/** "|"/*! "){NEWLINE} {
+ CG(comment_start_line) = CG(zend_lineno); + BEGIN(ST_DOC_COMMENT); + yymore();+} + 2) Why is it '/' '*' '*' and SPACE? 3) How about single line comments started by '//!'? 4) What about removing everything upto '*' if it is the first character after a new line starts? regards marcus