Patch to warn on source/template collision



Here's a patch to make gtkdoc warn if a symbol is documented both
inline and in the template files.

Look OK to people?

Thanks,
                                        Owen


Index: gtkdoc-mkdb.in
===================================================================
RCS file: /cvs/gnome/gtk-doc/gtkdoc-mkdb.in,v
retrieving revision 1.41
diff -u -p -r1.41 gtkdoc-mkdb.in
--- gtkdoc-mkdb.in	11 Mar 2002 18:16:35 -0000	1.41
+++ gtkdoc-mkdb.in	26 Apr 2002 01:02:11 -0000
@@ -1831,6 +1831,18 @@ sub MergeSourceDocumentation {
     my $symbol;
     foreach $symbol (keys (%SymbolDocs)) {
         $AllSymbols{$symbol} = 1;
+
+	my $have_tmpl_docs = 0;
+	
+	## See if the symbol is documented out-of-line
+	my $tmpl_doc = $SymbolDocs{$symbol};
+	$tmpl_doc = defined ($tmpl_doc) ? $tmpl_doc : "";
+	$tmpl_doc =~ s/<\/?[a-z]+>//g;
+	$tmpl_doc =~ s/\s//g;
+	if ($tmpl_doc ne "") {
+	    $have_tmpl_docs = 1;
+	}
+	
 	if (exists ($SourceSymbolDocs{$symbol})) {
 	    my $src_doc = $SourceSymbolDocs{$symbol};
 	    my $tmpl_doc = $SymbolDocs{$symbol};
@@ -1838,6 +1850,12 @@ sub MergeSourceDocumentation {
 	    $src_doc =~ s/^\s+//;
 	    $src_doc =~ s/\s+$//;
 
+	    if ($have_tmpl_docs) {
+		    print <<EOF;
+WARNING: Documentation in template file for $symbol being overriden by inline comments
+EOF
+	    }
+	    
             if ($src_doc ne "") {
                  $AllDocumentedSymbols{$symbol} = 1;
             }
@@ -1902,16 +1920,11 @@ WARNING: Parameter described in source c
 EOF
 		}
 	    }
-       } else {
-            ## See if the symbol is documented out-of-line
-	    my $tmpl_doc = $SymbolDocs{$symbol};
-	    $tmpl_doc = defined ($tmpl_doc) ? $tmpl_doc : "";
-            $tmpl_doc =~ s/<\/?[a-z]+>//g;
-            $tmpl_doc =~ s/\s//g;
-            if ($tmpl_doc ne "") {
-                 $AllDocumentedSymbols{$symbol} = 1;
-            }
-       }
+	} else {
+	    if ($have_tmpl_docs) {
+		$AllDocumentedSymbols{$symbol} = 1;		
+	    }
+	}
    }
 }
 



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