Bash.Script (Bash v0.3.0)

Copy Markdown View Source

Top-level script: a sequence of statements with separators.

Examples

# Simple script
%Script{
  statements: [
    %Assignment{name: "x", value: ...},
    {:separator, ";"},
    %Command{name: "echo", args: [...]}
  ]
}

# Single statement (no separators)
%Script{
  statements: [%Command{name: "echo", args: [...]}]
}

Summary

Types

output_entry()

@type output_entry() :: {:stdout, String.t()} | {:stderr, String.t()}

separator()

@type separator() :: {:separator, String.t()}

statement_or_separator()

@type statement_or_separator() :: Bash.AST.Statement.t() | separator()

t()

@type t() :: %Bash.Script{
  collector: pid() | nil,
  exit_code: 0..255 | nil,
  meta: Bash.AST.Meta.t(),
  shebang: String.t() | nil,
  state_updates: map(),
  statements: [statement_or_separator()]
}