Raxol.Terminal.ANSI.StateMachine (Raxol v0.5.0)
View SourceA state machine for parsing ANSI escape sequences. This module provides a more efficient alternative to regex-based parsing.
Summary
Functions
Creates a new parser state with default values.
Processes input bytes through the state machine. Returns the updated state and any parsed sequences.
Types
@type sequence_type() :: :csi | :osc | :sos | :pm | :apc | :esc | :text
@type state() ::
:ground
| :escape
| :csi_entry
| :csi_param
| :csi_intermediate
| :csi_final
| :osc_string
| :osc_string_maybe_st
| :dcs_entry
| :dcs_passthrough
| :dcs_passthrough_maybe_st
| :designate_charset
Functions
@spec new() :: parser_state()
Creates a new parser state with default values.
@spec process(parser_state(), binary()) :: {parser_state(), [sequence()]}
Processes input bytes through the state machine. Returns the updated state and any parsed sequences.