philip Thu Apr 5 04:22:45 2007 UTC
Modified files: /phpdoc/scripts xml_proto.php Log: Expand the constant search, examples that now work: * REGISTER_FOO_CONST(BAR); // _CONST or _CONSTANT * REGISTER_FOO_CONSTANT("BAR"); // BAR or "BAR" * REGISTER_U_CONST(FOO); // _U_ (unicode) Thanks to Sean and Greg for the strong regex advice :-) http://cvs.php.net/viewvc.cgi/phpdoc/scripts/xml_proto.php?r1=1.50&r2=1.51&diff_format=u Index: phpdoc/scripts/xml_proto.php diff -u phpdoc/scripts/xml_proto.php:1.50 phpdoc/scripts/xml_proto.php:1.51 --- phpdoc/scripts/xml_proto.php:1.50 Wed Apr 4 07:32:52 2007 +++ phpdoc/scripts/xml_proto.php Thu Apr 5 04:22:45 2007 @@ -16,7 +16,7 @@ | Authors: Brad House <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ - $Id: xml_proto.php,v 1.50 2007/04/04 07:32:52 philip Exp $ + $Id: xml_proto.php,v 1.51 2007/04/05 04:22:45 philip Exp $ */ /* @@ -461,14 +461,16 @@ function scan_for_constants($buffer) { - preg_match_all('/REGISTER_(?:MAIN_)?([A-Z]+)_CONSTANT\("(\S+)"/', $buffer, $matches, PREG_SET_ORDER); + preg_match_all('/REGISTER_(?:MAIN_)?([A-Z]+)_CONST(?:ANT)?\(([^),]+)/', $buffer, $matches, PREG_SET_ORDER); foreach ($matches as $const) { + $const[2] = trim($const[2], '"'); switch ($const[1]) { case 'LONG': $type = 'integer'; break; case 'DOUBLE': $type = 'float'; break; + case 'U': case 'STRINGL': case 'STRING': $type = 'string'; break;