# HG changeset patch # User John W. Eaton # Date 1389163211 18000 # Node ID 89e3601c33aa52c0d9de721abe09869e20311aa2 # Parent 9feb46ac68479f2cc39af70d09b563bbb419d0df# Parent 043ce378784948ff547e17a9db34a71032cfd31e maint: Periodic merge of gui-release to default. diff --git a/libinterp/parse-tree/lex.ll b/libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll +++ b/libinterp/parse-tree/lex.ll @@ -2622,7 +2622,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 (); diff --git a/test/parser.tst b/test/parser.tst --- a/test/parser.tst +++ b/test/parser.tst @@ -283,3 +283,7 @@ %! xyz(1) = 1; xyz /= 1; %! assert (xyz, 1); +%!test +%! a = [97 ... % comment +%! 'b']; +%! assert (a, 'ab');