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§
- Achitek
Ast - 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. - Comparison
Operator - Operators supported by comparison dependencies.
- Dependency
- A dependency expression from a prompt’s
depends_onattribute. - Parse
Error - Errors that can occur while parsing source text into an
AchitekAst. - Prompt
Type - 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.