changeset 28262:3e3ad0ae247f stable

handle comments in multi-line statements with push parser/lexer (bug #58198) * lex.ll (<LINE_COMMENT_START>{ANY_INCLUDING_NL}): With push lexer, return -1 at end of buffer if yytext begins with special ASCII 1 marker.
author John W. Eaton <jwe@octave.org>
date Mon, 04 May 2020 11:49:06 -0400
parents ec77c790fce2
children d63e05fdf11b d938c4d22200
files libinterp/parse-tree/lex.ll
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll	Sat Feb 22 17:26:34 2020 +0100
+++ b/libinterp/parse-tree/lex.ll	Mon May 04 11:49:06 2020 -0400
@@ -824,7 +824,11 @@
 
     curr_lexer->pop_start_state ();
 
-    HANDLE_EOB_OR_EOF (-2);
+    // If yytext contains the special ASCII 1 marker inserted by
+    // push_lexer::fill_flex_buffer and we are at the end of the buffer,
+    // return -1 to indicate that we are expecting more input.
+
+    HANDLE_EOB_OR_EOF (yytext[0] == '\001' ? -1 : -2);
 
     // Restore all characters except the ASCII 1 marker that was
     // inserted by push_lexer::fill_flex_buffer.