Skip to content

Commit

Permalink
lex.ll: Accept block comments at the command prompt (bug #64903)
Browse files Browse the repository at this point in the history
* lex.ll: Previously, the end of a block comment was also treated
as the end of a statement, which prevented loops with block comments
inside from being copy-pasted at the command prompt.  This patch
accepts block comments without ending the statement.
  • Loading branch information
arungiridhar committed Nov 17, 2023
1 parent 097da04 commit f3971e4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions libinterp/parse-tree/lex.ll
Original file line number Diff line number Diff line change
Expand Up @@ -784,16 +784,17 @@ ANY_INCLUDING_NL (.|{NL})
curr_lexer->m_block_comment_nesting_level--;
int status = -1;
if (curr_lexer->m_block_comment_nesting_level == 0)
{
status = -2;
curr_lexer->pop_start_state ();
}
HANDLE_EOB_OR_EOF (status);
if (curr_lexer->pending_token_count () > 0)
HANDLE_EOB_OR_EOF (-1);
else
HANDLE_EOB_OR_EOF (-2);
}
else
HANDLE_EOB_OR_EOF (-1);
}
%{
Expand Down

0 comments on commit f3971e4

Please sign in to comment.