JustBash.Parser.WordParts (JustBash v0.4.0)

View Source

Word Parts Parser

Parses word token values into AST nodes for:

  • Variable expansion: $VAR, ${VAR}, ${VAR:-default}
  • Command substitution: $(cmd), cmd
  • Arithmetic expansion: $((expr))
  • Glob patterns: *, ?, [...]
  • Quoted strings: 'literal', "with $expansion"
  • Tilde expansion: ~, ~user

Summary

Functions

Parse a word value into its component parts.

Types

parse_result()

@type parse_result() :: [JustBash.AST.word_part()]

Functions

parse(value, opts \\ [])

@spec parse(
  String.t(),
  keyword()
) :: parse_result()

Parse a word value into its component parts.

Options

  • :quoted - true if the token was double-quoted
  • :single_quoted - true if the token was single-quoted
  • :assignment - true if this is the RHS of an assignment