JustBash.Parser.Lexer (JustBash v0.4.0)
View SourceHand-written lexer for bash scripts.
Processes input as a binary with explicit state tracking, enabling native heredoc body consumption without the limitations of a context-free parser generator.
Summary
Functions
@spec tokenize(String.t()) :: {:ok, [JustBash.Parser.Lexer.Token.t()]} | {:error, JustBash.Parser.Lexer.Error.t()}
Tokenize input string into a list of tokens.
Returns {:ok, tokens} on success or {:error, %LexerError{}} on failure.
Use tokenize!/1 if you prefer exceptions.
@spec tokenize!(String.t()) :: [JustBash.Parser.Lexer.Token.t()]
Tokenize input string into a list of tokens.
Raises JustBash.Parser.Lexer.Error on failure.