changeset 880:391d6cb29a47 octave-forge

fix single character " x = description" INDEX entries
author pkienzle
date Fri, 28 Mar 2003 14:48:38 +0000
parents 0c39f6998404
children 3f56c4a164d3
files admin/make_index
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/admin/make_index	Thu Mar 27 21:21:05 2003 +0000
+++ b/admin/make_index	Fri Mar 28 14:48:38 2003 +0000
@@ -416,11 +416,18 @@
         } elsif (/^(\w.*?)\s*$/) {
 	    # category lines start in the left most column
             $category    = $1;
-        } elsif (/^\s+(\S.*\S)\s*=\s*(\S.*\S)\s*$/) {
+        } elsif (/^\s+(\S.*)=\s*(\S.*\S)\s*$/) {
+	    # Process "function = notes" explicit descriptions
 	    $function = $1;
 	    $description = $2;
 
-	    # expand all $id in the description
+	    # We used ...(\S.*)=... rather than (\S.*\S)\s*= to allow for
+	    # single character function names, but that means we may have
+	    # to trim some extra spaces of the function name.  Single
+	    # character descriptions get the treatment they deserve.
+	    $function =~ s/\s+$//;
+
+	    # expand all $var in the description
 	    my @parts = split('\$', $description);
 	    foreach my $i ( 1 .. $#parts ) {
 		$parts[$i] =~ /^(\w+)(\W.*)$/ or $parts[$i] =~ /^(\w+)()$/;
@@ -428,6 +435,7 @@
 	    }
 	    $description = join("",@parts);
 
+	    # record the function->description mapping
 	    $index_notes{$function} = $description;
 	    die "Function $function (line $.) has no category" unless $category;
 	    push @{$index_by_TB_cat{$toolbox}{$category}}, $function;