Mercurial > octave
changeset 27052:44d1fe403c19
eliminate mysterious newline output (bug #44934)
* lex.ll (<FQ_IDENT_START>{NL}): New pattern. Ignore newlines at the
beginning of a fully-qualified identifier.
(<FQ_IDENT_START>(\.\.\.){ANY_EXCEPT_NL}*{NL}): New pattern. Allow
continuation markers when looking for fully-qualified identifiers.
(<FQ_IDENT_START>{ANY_INCLUDING_NL}): Use "{ANY_INCLUDING_NL}" in
place of "." Call lexer_debug.
(<FQ_IDENT_START>{S}+): Call lexer_debug.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 17 Apr 2019 20:35:52 +0000 |
parents | 3e82b183fd27 |
children | 1bdfd2b523c9 |
files | libinterp/parse-tree/lex.ll |
diffstat | 1 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll Wed Apr 17 17:07:36 2019 +0000 +++ b/libinterp/parse-tree/lex.ll Wed Apr 17 20:35:52 2019 +0000 @@ -1092,6 +1092,7 @@ <FQ_IDENT_START>{FQIDENT} { curr_lexer->lexer_debug ("<FQ_IDENT_START>{FQIDENT}{S}*"); + curr_lexer->pop_start_state (); int id_tok = curr_lexer->handle_fq_identifier (); @@ -1105,14 +1106,26 @@ } <FQ_IDENT_START>{S}+ { + curr_lexer->lexer_debug ("<FQ_IDENT_START>{S}+"); + curr_lexer->m_current_input_column += yyleng; curr_lexer->mark_previous_token_trailing_space (); } -<FQ_IDENT_START>. { +<FQ_IDENT_START>(\.\.\.){ANY_EXCEPT_NL}*{NL} { + curr_lexer->lexer_debug ("<FQ_IDENT_START>(\\.\\.\\.){ANY_EXCEPT_NL}*{NL}"); + + curr_lexer->m_input_line_number++; + curr_lexer->m_current_input_column = 1; + } + +<FQ_IDENT_START>{ANY_INCLUDING_NL} { + curr_lexer->lexer_debug ("<FQ_IDENT_START>{ANY_INCLUDING_NL}"); + // If input doesn't match FQIDENT, return char and go to previous // start state. + yyless (0); curr_lexer->pop_start_state (); }