Lines starting with "returns"



Here is a patch to fix #65997. It changes the source scanning of gtk-doc
to ignore lines starting with "returns" when the return value was
already specified as @returns: in the parameter section. 

OK to commit ?


--- gtkdoc-mkdb.in.orig	Mon Mar 11 23:29:04 2002
+++ gtkdoc-mkdb.in	Sun Apr 28 00:23:27 2002
@@ -1606,6 +1606,7 @@
     my ($in_description, $in_return);
     my ($description, $return_desc, $return_start);
     my $current_param;
+    my $ignore_returns;
     my @params;
     while (<SRCFILE>) {
 	# Look for the start of a comment block.
@@ -1623,6 +1624,7 @@
 		$description = "";
 		$return_desc = "";
 		$current_param = -1;
+		$ignore_returns = 0;
 		@params = ();
 	    }
 	    next;
@@ -1694,7 +1696,7 @@
 	    # Get rid of 'Description:'
 	    s%^\s*Description:%%;
 
-	    if (m%^\s*(returns:|return\s+value:|returns\s*)%i) {
+	    if (!$ignore_returns && m%^\s*(returns:|return\s+value:|returns\s*)%i) {
 #		print "RETURNS: $_";
 		$return_start = $1;
 		$return_desc = $';
@@ -1719,6 +1721,9 @@
 	    # Allow '...' as the Varargs parameter.
 	    if ($param_name eq "...") {
 		$param_name = "Varargs";
+	    }
+	    if ("\L$param_name" eq "returns") {
+	      $ignore_returns = 1;
 	    }
 	    push (@params, $param_name);
 	    push (@params, $');




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