Repository: microsoft/terminal
File: src/terminal/parser/IStateMachineEngine.hpp (C++)

Code before:

        virtual ~IStateMachineEngine() = 0;
        IStateMachineEngine(const IStateMachineEngine&) = default;
        IStateMachineEngine(IStateMachineEngine&&) = default;
        IStateMachineEngine& operator=(const IStateMachineEngine&) = default;
        IStateMachineEngine& operator=(IStateMachineEngine&&) = default;

        virtual bool EncounteredWin32InputModeSequence() const noexcept = 0;

        virtual bool ActionExecute(const wchar_t wch) = 0;
        virtual bool ActionExecuteFromEscape(const wchar_t wch) = 0;
        virtual bool ActionPrint(const wchar_t wch) = 0;
        virtual bool ActionPrintString(const std::wstring_view string) = 0;

        virtual bool ActionPassThroughString(const std::wstring_view string) = 0;

        virtual bool ActionEscDispatch(const VTID id) = 0;
        virtual bool ActionVt52EscDispatch(const VTID id, const VTParameters parameters) = 0;
        virtual bool ActionCsiDispatch(const VTID id, const VTParameters parameters) = 0;
        virtual StringHandler ActionDcsDispatch(const VTID id, const VTParameters parameters) = 0;

        virtual bool ActionClear() = 0;

        virtual bool ActionIgnore() = 0;

        virtual bool ActionOscDispatch(const wchar_t wch,
                                       const size_t parameter,
                                       const std::wstring_view string) = 0;

        virtual bool ActionSs3Dispatch(const wchar_t wch, const VTParameters parameters) = 0;

    protected:
        IStateMachineEngine() = default;
    };

    inline IStateMachineEngine::~IStateMachineEngine() = default;
}


Review comment (suggestion):
I dropped the `wch` parameter from this method because it's never actually used for anything. It just indicated whether the sequence was terminated with a `BEL` or an `ST` backslash, but that's of no relevance to anyone.

Code after:

        virtual ~IStateMachineEngine() = 0;
        IStateMachineEngine(const IStateMachineEngine&) = default;
        IStateMachineEngine(IStateMachineEngine&&) = default;
        IStateMachineEngine& operator=(const IStateMachineEngine&) = default;
        IStateMachineEngine& operator=(IStateMachineEngine&&) = default;

        virtual bool EncounteredWin32InputModeSequence() const noexcept = 0;

        virtual bool ActionExecute(const wchar_t wch) = 0;
        virtual bool ActionExecuteFromEscape(const wchar_t wch) = 0;
        virtual bool ActionPrint(const wchar_t wch) = 0;
        virtual bool ActionPrintString(const std::wstring_view string) = 0;

        virtual bool ActionPassThroughString(const std::wstring_view string) = 0;

        virtual bool ActionEscDispatch(const VTID id) = 0;
        virtual bool ActionVt52EscDispatch(const VTID id, const VTParameters parameters) = 0;
        virtual bool ActionCsiDispatch(const VTID id, const VTParameters parameters) = 0;
        virtual StringHandler ActionDcsDispatch(const VTID id, const VTParameters parameters) = 0;

        virtual bool ActionClear() = 0;

        virtual bool ActionIgnore() = 0;

        virtual bool ActionOscDispatch(const size_t parameter, const std::wstring_view string) = 0;

        virtual bool ActionSs3Dispatch(const wchar_t wch, const VTParameters parameters) = 0;

    protected:
        IStateMachineEngine() = default;
    };

    inline IStateMachineEngine::~IStateMachineEngine() = default;
}