diff libinterp/parse-tree/lex.ll @ 31727:1f04951057bf

avoid some calls to get_input_system and get_evaluator Provide some convenience functions so that instead of writing things like input_system& input_sys = interp.get_input_system (); input_sys.PS1 (prompt); we can just write interp.PS1 (prompt); Although this a minor change, I think it will make writing extensions for Octave easier if we provide access to most features through the interpreter object itself instead of requiring users to first obtain access to an internal object. * interpreter.h, interpreter.cc (interpreter::PS1, interpreter::set_PS1, interpreter::PS2, interpreter::set_PS2, interpreter::PS4, interpreter::set_PS4): New convenience functions. Instead of getting a reference to the input_system or tree_evaluator object from the interpreter and then calling the PS1, PS2, etc. function through those references, just call through the reference to the interpreter object.
author John W. Eaton <jwe@octave.org>
date Wed, 11 Jan 2023 21:45:45 -0500
parents 5f11de0e7440
children 21f9b34eb893
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll	Wed Jan 11 16:15:38 2023 -0500
+++ b/libinterp/parse-tree/lex.ll	Wed Jan 11 21:45:45 2023 -0500
@@ -4010,10 +4010,8 @@
 
     if (m_input_buf.empty ())
       {
-        input_system& input_sys = m_interpreter.get_input_system ();
-
         std::string ps
-          = m_initial_input ? input_sys.PS1 () : input_sys.PS2 ();
+          = m_initial_input ? m_interpreter.PS1 () : m_interpreter.PS2 ();
 
         std::string prompt = command_editor::decode_prompt_string (ps);