JustBash.Commands.Sed.Parser (JustBash v0.4.0)
View SourceParser for SED scripts.
Parses SED script strings into command structures that can be executed by the Executor.
Summary
Functions
Compile a regex pattern with the given flags. Converts BRE (Basic Regular Expression) to ERE for Elixir's PCRE engine.
Parse SED scripts into command structures.
Types
@type address() :: nil | :last | {:line, pos_integer()} | {:regex, Regex.t()}
@type substitute_flags() :: [:global | :caseless | :print | {:nth, pos_integer()}]
Functions
@spec compile_regex(String.t(), substitute_flags(), ctx()) :: {:ok, Regex.t()} | {:error, String.t()}
Compile a regex pattern with the given flags. Converts BRE (Basic Regular Expression) to ERE for Elixir's PCRE engine.
@spec parse([String.t()], boolean(), JustBash.Limit.t() | nil) :: {:ok, [sed_command()]} | {:error, String.t()}
Parse SED scripts into command structures.
Returns {:ok, commands} on success or {:error, message} on failure.