bash-ast 0.8.20

Typed Rust AST over tree-sitter-bash. Parses bash source into a strongly-typed tree suitable for structural analysis (permission gating, linting, refactoring) rather than execution.
Documentation
use thiserror::Error;
use tree_sitter::Range;

#[derive(Debug, Error)]
pub enum ParseError {
    #[error("tree-sitter failed to initialize the bash language")]
    LanguageInit,

    #[error("tree-sitter returned no parse tree")]
    NoTree,

    #[error("unknown node kind `{kind}` at {range:?}")]
    UnknownNode { kind: String, range: Range },

    #[error("expected field `{field}` on `{parent_kind}` at {range:?}")]
    MissingField {
        parent_kind: String,
        field: &'static str,
        range: Range,
    },

    #[error("source contains a syntax error at {range:?}")]
    SyntaxError { range: Range },
}