vrana           Fri Sep 10 09:39:06 2004 EDT

  Modified files:              
    /phpdoc/scripts     check-references.php 
  Log:
  Use role="reference" together with &
  
http://cvs.php.net/diff.php/phpdoc/scripts/check-references.php?r1=1.8&r2=1.9&ty=u
Index: phpdoc/scripts/check-references.php
diff -u phpdoc/scripts/check-references.php:1.8 phpdoc/scripts/check-references.php:1.9
--- phpdoc/scripts/check-references.php:1.8     Thu Aug 19 07:05:13 2004
+++ phpdoc/scripts/check-references.php Fri Sep 10 09:39:06 2004
@@ -134,7 +134,7 @@
 $source_refs = array(); // array("function_name" => number_ref, ...)
 $source_types = array(); // array("function_name" => array("type_spec", filename, 
lineno), ...)
 $source_arg_counts = array(); // array("function_name" => array(disallowed_count => 
true, ...), ...)
-foreach (array_merge(glob("$zend_dir/*.c*"), glob("$phpsrc_dir/ext/*/*.c*"), 
glob("$pecl_dir/*/*.c*")) as $filename) {
+foreach (array_merge(glob("$zend_dir/*.c*"), glob("$phpsrc_dir/ext/*/*.c*"), 
glob("$phpsrc_dir/sapi/*/*.c*"), glob("$pecl_dir/*/*.c*")) as $filename) {
        $file = file_get_contents($filename);
        
        // references
@@ -238,10 +238,10 @@
                
                // references
                $source_ref = (isset($source_refs[$function_name]) ? 
$source_refs[$function_name] : null);
-               preg_match_all('~<parameter>(&amp;)?~S', $methodsynopsis, $matches);
+               preg_match_all('~<parameter( role="reference")?>(&amp;)?~S', 
$methodsynopsis, $matches);
                $byref = array();
                foreach ($matches[1] as $key => $val) {
-                       if ($val) {
+                       if ($val || $matches[2][$key]) {
                                $byref[] = $key + 1;
                        }
                }
@@ -255,7 +255,7 @@
                }
                
                // parameter types and optional
-               
preg_match_all('~<methodparam(\\s+choice=[\'"]opt[\'"])?>\\s*<type>([^<]+)</type>\\s*<parameter>([^<]+)~i',
 $methodsynopsis, $matches); // (PREG_OFFSET_CAPTURE can be used to get precise line 
numbers)
+               
preg_match_all('~<methodparam(\\s+choice=[\'"]opt[\'"])?>\\s*<type>([^<]+)</type>\\s*<parameter(?:
 role="reference")?>([^<]+)~i', $methodsynopsis, $matches); // (PREG_OFFSET_CAPTURE 
can be used to get precise line numbers)
                foreach ($matches[2] as $i => $val) {
                        if (!preg_match("~callback|$valid_types~", $val)) {
                                echo "Parameter #" . ($i+1) . " has wrong type '$val' 
in $filename on line " . ($lineno + $i + 1) . ".\n";

Reply via email to