# HG changeset patch # User John W. Eaton # Date 1632366552 14400 # Node ID 501fe2c8a8800b9f4aad62d60c7d7da61bd622b1 # Parent 3e419a830e90507dbcdeb791b3dc6ebf493ef5d1 initialize filepos to (1, 1) when function appears in eval string * lex.ll (base_lexer::make_keyword_token): Set filepos to (1, 1) when a function token appears in an eval string. diff -r 3e419a830e90 -r 501fe2c8a880 libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Tue Sep 21 13:32:41 2021 -0400 +++ b/libinterp/parse-tree/lex.ll Wed Sep 22 23:09:12 2021 -0400 @@ -2857,6 +2857,10 @@ m_reading_script_file = false; } + // FIXME: should we be asking directly whether input is coming + // from an eval string instead of that it is not coming from a + // file? + if (! (m_reading_fcn_file || m_reading_script_file || m_reading_classdef_file)) { @@ -2867,9 +2871,10 @@ // FIXME: do we need to save and restore the file position // or just reset the line number here? The goal is to // track line info for command-line functions relative - // to the function keyword. - - m_filepos = filepos (); + // to the function keyword. Should we really be setting + // the line and column info to (1, 1) here? + + m_filepos = filepos (1, 1); update_token_positions (slen); } break;