diff doc/interpreter/munge-texi.cc @ 9014:71fca0fc2436

save source file names for functions as comments in .texi files
author John W. Eaton <jwe@octave.org>
date Wed, 25 Mar 2009 12:54:17 -0400
parents eb63fbe60fab
children 16f53d29049f
line wrap: on
line diff
--- a/doc/interpreter/munge-texi.cc
+++ b/doc/interpreter/munge-texi.cc
@@ -245,7 +245,23 @@
 		    {
 		      std::string doc_string = help_text[symbol_name];
 
+		      size_t len = doc_string.length ();
+
 		      int j = 0;
+
+		      // If there is a leading comment with the file
+		      // name, copy it to the output.
+		      if (len > 1
+			  && doc_string[j] == '@'
+			  && doc_string[j+1] == 'c')
+			{
+			  j = 2;
+			  while (doc_string[j++] != '\n')
+			    /* find eol */;
+
+			  os << doc_string.substr (0, j);
+			}
+
 		      while (doc_string[j] == ' ')
 			j++;