hholzgra                Sat Jan 21 19:50:08 2006 UTC

  Modified files:              
    /phpdoc/scripts     zendapi_protos.php 
  Log:
  parse multiline macro definitions (plus some whitespace fixes)
  
  
http://cvs.php.net/viewcvs.cgi/phpdoc/scripts/zendapi_protos.php?r1=1.23&r2=1.24&diff_format=u
Index: phpdoc/scripts/zendapi_protos.php
diff -u phpdoc/scripts/zendapi_protos.php:1.23 
phpdoc/scripts/zendapi_protos.php:1.24
--- phpdoc/scripts/zendapi_protos.php:1.23      Sat Jan 21 15:55:55 2006
+++ phpdoc/scripts/zendapi_protos.php   Sat Jan 21 19:50:08 2006
@@ -35,7 +35,10 @@
     while (!feof($in)) {
         // TODO a prototype may span more than one line?
         $line = trim(fgets($in));
-
+        if (substr($line, -1) == "\\") { // multiline macro, read one more line
+            $line = substr($line, 0, -1) . trim(fgets($in));
+        }       
+        
         // first we look for prototypes marked with ZEND_API 
         if (preg_match('/^\s*(ZEND|TSRM|CWD)_API\s+(\S+)\s+(\S+)\((.*)\);$/U', 
$line, $matches)) {
             // parse prototypes, step #1
@@ -92,8 +95,8 @@
                                           "return_type" => $return_type, 
                                           "params"      => $params,
                                           "api_type"    => $api_type,
-                                                                               
  "infile"      => $infile
-                                                                               
  );
+                                          "infile"      => $infile
+                                          );
         }        
 
         // next we look for macros that seem to be just wrappers around 
existing functions
@@ -106,8 +109,8 @@
           $wrappers[$wrapper] = array("function"   => $function, 
                                       "wrapper"    => $wrapper, 
                                       "param_list" => $param_list,
-                                                                         
"infile"     => $infile
-                                                                         );
+                                      "infile"     => $infile
+                                      );
         }
     }
 }
@@ -128,11 +131,11 @@
     }
 
     $functions[$name] = array("name"        => $name,
-                                                         "return_type" => 
$function["return_type"], 
-                                                         "params"      => 
$params,
-                                                         "api_type"    => 
$function["api_type"],
-                                                         "infile"      => 
$wrapper["infile"]
-                                                         );
+                              "return_type" => $function["return_type"], 
+                              "params"      => $params,
+                              "api_type"    => $function["api_type"],
+                              "infile"      => $wrapper["infile"]
+                              );
   }
 }
 

Reply via email to