Skip to main content

Crate achitekfile

Crate achitekfile 

Source
Expand description

A Tree-Sitter backed semantic parser for Achitek

let source = r#"
    blueprint {
        version = "1.0.0"
        name = "web-app"
    }

    prompt "database" {
        type = select
        choices = ["postgres", "sqlite"]
        default = "postgres"
    }

    prompt "orm" {
        type = select
        choices = ["sqlx", "diesel"]
        depends_on = database != "sqlite"
    }
"#;

achitekfile wraps the tree-sitter-achitekfile grammar and exposes a small semantic API over the concrete Tree-sitter syntax tree.

Structs§

AchitekAst
A parsed Achitekfile backed by its original Tree-sitter tree and source.
Prompt
A parsed prompt declaration from an Achitekfile.
Validation
Validation rules for a prompt.

Enums§

AstError
Errors that can occur while reading semantic data from an AchitekAst.
ComparisonOperator
Operators supported by comparison dependencies.
Dependency
A dependency expression from a prompt’s depends_on attribute.
ParseError
Errors that can occur while parsing source text into an AchitekAst.
PromptType
The supported prompt input types.
Value
A literal or identifier value parsed from an Achitekfile.

Functions§

from_str
Parses Achitekfile source text into an AchitekAst.