[gtk-doc] scan: improve the inline function parsing further



commit 57a650d9d950315f79d9345a3a6149044b6badea
Author: Stefan Kost <ensonic users sf net>
Date:   Tue Jul 13 15:47:38 2010 +0300

    scan: improve the inline function parsing further
    
    Add the full prototype (args) before starting to skip. Reset skip mode when function got parsed.

 gtkdoc-scan.in |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in
index c7dc062..a0a74b8 100755
--- a/gtkdoc-scan.in
+++ b/gtkdoc-scan.in
@@ -611,7 +611,7 @@ sub ScanHeader {
 		# declaration of struct <struct_name>.
 		$symbol = $1;
 		$decl = $_;
-                # we will find the correct level as below we do $level += tr/{//;
+                 # we will find the correct level as below we do $level += tr/{//;
 		$level = 0;
 		$in_declaration = "struct";
 		#print "DEBUG: Struct(_): $symbol\n";
@@ -636,7 +636,10 @@ sub ScanHeader {
 	    if ($skip_block == 0) {
 	        $decl .= $_;
 	    } else {
-                if (m%{%) {
+                if (m%(.*?){%) {
+                    if ($skip_block == 1) {
+                        $decl .= $1;
+                    }
                     $skip_block += 1;
                 } elsif (m%}%) {
                     $skip_block -= 1;
@@ -646,6 +649,10 @@ sub ScanHeader {
                         $skip_block = 0;
                         #print "2: ---\n";
                     }
+                } else {
+                    if ($skip_block == 1) {
+                        $decl .= $_;
+                    }
                 }
             }
 	}
@@ -674,6 +681,7 @@ sub ScanHeader {
                     }
                 }
                 $in_declaration = "";
+                $skip_block = 0;
 	    }
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]