Raxol.Terminal.ParserStateManager (Raxol v2.0.1)
View SourceConsolidated terminal parser state manager combining simple emulator operations with comprehensive parser state management.
This module consolidates functionality from:
- Simple parser state operations on Emulator structs
- Comprehensive parser state management from Parser.State.Manager
Usage
For simple emulator operations:
emulator = ParserStateManager.reset_parser_state(emulator)For comprehensive parser operations:
manager = ParserStateManager.create_parser_manager()
manager = ParserStateManager.process_char(manager, ?A)Migration from Parser.State.Manager
Use create_parser_manager/0 instead of Parser.State.Manager.new/0
Summary
Functions
Adds an intermediate character. Returns the updated emulator.
Adds a parameter to the current parser state. Returns the updated emulator.
Clears all intermediate characters. Returns the updated emulator.
Clears all parser parameters. Returns the updated emulator.
Gets the current intermediate characters. Returns the list of intermediate characters.
Gets the current parser mode. Returns the current mode.
Gets the current parser parameters. Returns the list of parameters.
Gets the current parser state. Returns the parser state.
Processes a character in the current parser state. Returns the updated emulator and any output.
Resets the parser state to its initial state. Returns the updated emulator.
Sets the intermediate characters. Returns the updated emulator.
Sets the parser mode. Returns the updated emulator.
Sets the parser parameters. Returns the updated emulator.
Updates the parser state. Returns the updated emulator.
Functions
@spec add_intermediate(Raxol.Terminal.Emulator.t(), char()) :: Raxol.Terminal.Emulator.t()
Adds an intermediate character. Returns the updated emulator.
@spec add_param(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
Adds a parameter to the current parser state. Returns the updated emulator.
@spec clear_intermediates(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Clears all intermediate characters. Returns the updated emulator.
@spec clear_params(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Clears all parser parameters. Returns the updated emulator.
@spec get_intermediates(Raxol.Terminal.Emulator.t()) :: [char()]
Gets the current intermediate characters. Returns the list of intermediate characters.
@spec get_mode(Raxol.Terminal.Emulator.t()) :: atom()
Gets the current parser mode. Returns the current mode.
@spec get_params(Raxol.Terminal.Emulator.t()) :: [String.t()]
Gets the current parser parameters. Returns the list of parameters.
@spec get_parser_state(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.ParserState.t()
Gets the current parser state. Returns the parser state.
@spec process_char(Raxol.Terminal.Emulator.t(), char()) :: {Raxol.Terminal.Emulator.t(), any()}
Processes a character in the current parser state. Returns the updated emulator and any output.
@spec reset_parser_state(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Resets the parser state to its initial state. Returns the updated emulator.
@spec set_intermediates(Raxol.Terminal.Emulator.t(), [char()]) :: Raxol.Terminal.Emulator.t()
Sets the intermediate characters. Returns the updated emulator.
@spec set_mode(Raxol.Terminal.Emulator.t(), atom()) :: Raxol.Terminal.Emulator.t()
Sets the parser mode. Returns the updated emulator.
@spec set_params(Raxol.Terminal.Emulator.t(), [String.t()]) :: Raxol.Terminal.Emulator.t()
Sets the parser parameters. Returns the updated emulator.
@spec update_parser_state(Raxol.Terminal.Emulator.t(), Raxol.Terminal.ParserState.t()) :: Raxol.Terminal.Emulator.t()
Updates the parser state. Returns the updated emulator.