Mercurial > hg > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
18258:36057e2411f8 | 18261:1f072ae35ede |
---|---|
2529 | 2529 |
2530 if (have_comment) | 2530 if (have_comment) |
2531 { | 2531 { |
2532 comment_text = &yytxt[offset]; | 2532 comment_text = &yytxt[offset]; |
2533 | 2533 |
2534 // finish_comment sets at_beginning_of_statement to true but | |
2535 // that's not be correct if we are handling a continued | |
2536 // statement. Preserve the current state. | |
2537 | |
2538 bool saved_bos = at_beginning_of_statement; | |
2539 | |
2534 finish_comment (octave_comment_elt::end_of_line); | 2540 finish_comment (octave_comment_elt::end_of_line); |
2541 | |
2542 at_beginning_of_statement = saved_bos; | |
2535 } | 2543 } |
2536 | 2544 |
2537 decrement_promptflag (); | 2545 decrement_promptflag (); |
2538 input_line_number++; | 2546 input_line_number++; |
2539 current_input_column = 1; | 2547 current_input_column = 1; |