Bash.AST.BraceExpand (Bash v0.6.0)

Copy Markdown View Source

Brace expansion AST node.

Represents brace expansion patterns like {a,b,c} or {1..10}.

Types

  • :list - Comma-separated alternatives: {a,b,c}
  • :range - Sequence generation: {1..10}, {a..z}, {1..10..2}

Examples

# List: {a,b,c}
%BraceExpand{type: :list, items: ["a", "b", "c"]}

# Numeric range: {1..5}
%BraceExpand{type: :range, range_start: "1", range_end: "5"}

# Range with step: {1..10..2}
%BraceExpand{type: :range, range_start: "1", range_end: "10", step: 2}

# Zero-padded: {01..05}
%BraceExpand{type: :range, range_start: "01", range_end: "05", zero_pad: 2}

Summary

Types

t()

@type t() :: %Bash.AST.BraceExpand{
  items: [[word_part()]] | nil,
  meta: Bash.AST.Meta.t() | nil,
  range_end: String.t() | nil,
  range_start: String.t() | nil,
  step: integer() | nil,
  type: :list | :range,
  zero_pad: non_neg_integer() | nil
}

word_part()

@type word_part() ::
  {:literal, String.t()}
  | {:brace_expand, t()}
  | {:variable, String.t()}
  | {:variable_braced, String.t(), keyword()}
  | {:command_subst, String.t()}
  | {:arith_expand, String.t()}
  | {:single_quoted, String.t()}
  | {:double_quoted, [word_part()]}