diff src/lex.l @ 8537:17ef48c699a5

lex.l (grab_comment_block): if not reading from a file, bail at first newline inside a comment:
author John W. Eaton <jwe@octave.org>
date Mon, 19 Jan 2009 20:21:45 -0500
parents de1b944d5306
children 1652e39b934e
line wrap: on
line diff
--- a/src/lex.l	Mon Jan 19 19:37:34 2009 -0500
+++ b/src/lex.l	Mon Jan 19 20:21:45 2009 -0500
@@ -1667,6 +1667,20 @@
 	      at_bol = true;
 	      current_input_column = 0;
 	      in_comment = false;
+
+	      // FIXME -- bailing out here prevents things like
+	      //
+	      //    octave> # comment
+	      //    octave> x = 1
+	      //
+	      // from failing at the command line, while still
+	      // allowing blocks of comments to be grabbed properly
+	      // for function doc strings.  But only the first line of
+	      // a mult-line doc string will be picked up for
+	      // functions defined on the command line.  We need a
+	      // better way of collecting these comments...
+	      if (! (reading_fcn_file || reading_script_file))
+		goto done;
 	    }
 	}
       else