# HG changeset patch # User John W. Eaton # Date 1232414505 18000 # Node ID 17ef48c699a508ff443e95de5b66389a6aaf6f7b # Parent de1b944d5306c53bc425db5709c8247f849068af lex.l (grab_comment_block): if not reading from a file, bail at first newline inside a comment: diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2009-01-19 John W. Eaton + * lex.l (grab_comment_block): If not reading input from a file, + bail out at first newline inside a comment. + * lex.l (lexer_debug_flag): New static variable. (F__lexer_debug_flag__): New function. (LEXER_DEBUG): New macro. Use it in all patterns. diff --git a/src/lex.l b/src/lex.l --- a/src/lex.l +++ b/src/lex.l @@ -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