diff libinterp/parse-tree/lex.h @ 16253:a89cf57ba3a5

partial cleanup of continuation handling in lexer * lex.h, lex.ll (octave_lexer::handle_continuation): New function. (octave_lexer::finish_comment): Move to octave_lexer::finish_comment. Don't return token. New argument, looking_at_continuation. If not handling continuation, unput newline character. (^{S}*{CCHAR}\{{S}*{NL}): Call yyless before finishing comment. (^{S}*{CCHAR}\{{S}*{NL}, <BLOCK_COMMENT_START>^{S}*{CCHAR}\{{S}*{NL}, <LINE_COMMENT_START>{ANY_INCLUDING_NL}, <LINE_COMMENT_START>{S}*{CCHAR}.*{NL}): Don't return token. (<LINE_COMMENT_START>{S}*{CCHAR}.*{NL}): Don't give COMMAND_START start state special treatment. ({CONT}{S}*{NL}|{CONT}{S}*{COMMENT}): Call octave_lexer::handle_continuation.
author John W. Eaton <jwe@octave.org>
date Sat, 09 Mar 2013 21:44:14 -0500
parents 2b15ae55c721
children b8a2df776118 12bf6a3f8c45
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.h	Sun Mar 10 00:37:06 2013 -0500
+++ b/libinterp/parse-tree/lex.h	Sat Mar 09 21:44:14 2013 -0500
@@ -253,8 +253,6 @@
 
   void reset (void);
 
-  int finish_comment (octave_comment_elt::comment_type typ);
-
   // true means that we have encountered eof on the input stream.
   bool end_of_input;
 
@@ -496,6 +494,11 @@
 
   void handle_number (void);
 
+  void handle_continuation (void);
+
+  void finish_comment (octave_comment_elt::comment_type typ,
+                       bool looking_at_continuation = false);
+
   bool have_continuation (bool trailing_comments_ok = true);
 
   bool have_ellipsis_continuation (bool trailing_comments_ok = true);