Crate brush_parser

Source
Expand description

Implements a tokenizer and parsers for POSIX / bash shell syntax.

Modules§

arithmetic
Parser for shell arithmetic expressions.
ast
Defines the Abstract Syntax Tree (ast) for shell programs. Includes types and utilities for manipulating the AST.
pattern
Implements parsing for shell glob and extglob patterns.
prompt
Parser for shell prompt syntax (e.g., PS1).
test_command
Parser for shell test commands.
word
Parser for shell words, used in expansion and other contexts.

Structs§

Parser
Implements parsing for shell programs.
ParserOptions
Options used to control the behavior of the parser.
SourceInfo
Information about the source of tokens.
SourcePosition
Represents a position in a source shell script.
TokenLocation
Represents the location of a token in its source shell script.
TokenizerOptions
Options controlling how the tokenizer operates.

Enums§

ParseError
Represents an error that occurred while parsing tokens.
TestCommandParseError
Represents an error that occurred while parsing a (non-extended) test command.
Token
Represents a token extracted from a shell script.
WordParseError
Represents an error that occurred while parsing a word.

Functions§

parse_tokens
Parses a sequence of tokens into the abstract syntax tree (AST) of a shell program.
tokenize_str
Break the given input shell script string into tokens, returning the tokens.
tokenize_str_with_options
Break the given input shell script string into tokens, returning the tokens.
uncached_tokenize_str
Break the given input shell script string into tokens, returning the tokens. No caching is performed.
unquote_str
Return a string with all the quoting removed.