diff src/parse.y @ 4426:51a0dcde8778

[project @ 2003-06-13 19:16:37 by jwe]
author jwe
date Fri, 13 Jun 2003 19:16:38 +0000
parents db5e0814277a
children f3c21a1d1c62
line wrap: on
line diff
--- a/src/parse.y	Fri Jun 13 15:08:26 2003 +0000
+++ b/src/parse.y	Fri Jun 13 19:16:38 2003 +0000
@@ -112,7 +112,7 @@
 int current_input_column = 1;
 
 // Buffer for help text snagged from function files.
-std::string help_buf;
+std::stack<std::string> help_buf;
 
 // Buffer for comments appearing before a function statement.
 static std::string fcn_comment_header;
@@ -2621,13 +2621,15 @@
 
   id->define (fcn, symbol_record::USER_FUNCTION);
 
-  id->document (help_buf);
-
-  help_buf.resize (0);
+  if (! help_buf.empty ())
+    {
+      id->document (help_buf.top ());
+      help_buf.pop ();
+    }
 
   if (lexer_flags.parsing_nested_function < 0)
     lexer_flags.parsing_nested_function = 0;
-  
+
   return fcn;
 }
 
@@ -3343,9 +3345,12 @@
 
 	  reset_parser ();
 
-	  help_buf = gobble_leading_white_space (ffile, true, true, true);
-
-	  octave_comment_buffer::append (help_buf);
+	  std::string txt
+	    = gobble_leading_white_space (ffile, true, true, true);
+
+	  help_buf.push (txt);
+
+	  octave_comment_buffer::append (txt);
 
 	  // XXX FIXME XXX -- this should not be necessary.
 	  gobble_leading_white_space (ffile, false, true, false);