comparison 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
comparison
equal deleted inserted replaced
9013:3b1908b58662 9014:71fca0fc2436
243 fatal ("end of file while reading @DOCSTRING command"); 243 fatal ("end of file while reading @DOCSTRING command");
244 else 244 else
245 { 245 {
246 std::string doc_string = help_text[symbol_name]; 246 std::string doc_string = help_text[symbol_name];
247 247
248 size_t len = doc_string.length ();
249
248 int j = 0; 250 int j = 0;
251
252 // If there is a leading comment with the file
253 // name, copy it to the output.
254 if (len > 1
255 && doc_string[j] == '@'
256 && doc_string[j+1] == 'c')
257 {
258 j = 2;
259 while (doc_string[j++] != '\n')
260 /* find eol */;
261
262 os << doc_string.substr (0, j);
263 }
264
249 while (doc_string[j] == ' ') 265 while (doc_string[j] == ' ')
250 j++; 266 j++;
251 267
252 if (doc_string.substr (j, 15) == "-*- texinfo -*-") 268 if (doc_string.substr (j, 15) == "-*- texinfo -*-")
253 { 269 {