Mercurial > hg > octave-nkf
diff libinterp/parse-tree/lex.ll @ 18261:1f072ae35ede stable
fix parsing of single quote after continuation and comment (bug #41048)
* lex.ll (octave_base_lexer::handle_continuation): Preserve state of
at_beginning_of_statement across call to finish_comment.
* parser.tst: New test.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 08 Jan 2014 01:26:49 -0500 |
parents | 7af19113ec43 |
children | 043ce3787849 b14cdae65abd |
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll +++ b/libinterp/parse-tree/lex.ll @@ -2531,7 +2531,15 @@ { comment_text = &yytxt[offset]; + // finish_comment sets at_beginning_of_statement to true but + // that's not be correct if we are handling a continued + // statement. Preserve the current state. + + bool saved_bos = at_beginning_of_statement; + finish_comment (octave_comment_elt::end_of_line); + + at_beginning_of_statement = saved_bos; } decrement_promptflag ();