Expand description
Public facade for Draxl, an agent-native source language with explicit syntax identity.
Draxl makes syntax identity explicit with stable node ids, ranks, anchors, and semantic patch operators so tools can edit the program tree directly instead of patching text spans.
This crate is the intended Rust integration surface for the workspace. It keeps the common workflows small and explicit while still re-exporting the lower-level crates for callers that need finer control.
let source = "@m1 mod demo { @f1[a] fn run() { @s1[a] @e1 work(); } }";
let file = draxl::parse_and_validate(source)?;
let formatted = draxl::format_source(source)?;
let lowered = draxl::lower_rust_source(source)?;
assert_eq!(file.items.len(), 1);
assert!(formatted.contains("@f1[a] fn run()"));
assert!(lowered.contains("fn run()"));Re-exports§
pub use draxl_ast as ast;pub use draxl_lower_rust as lower_rust;pub use draxl_parser as parser;pub use draxl_patch as patch;pub use draxl_printer as printer;pub use draxl_validate as validate;
Enums§
- Error
- Top-level error for parse-and-validate workflows.
Functions§
- apply_
patch - Applies a single structured patch operation.
- apply_
patches - Applies multiple structured patch operations in order.
- dump_
json_ file - Emits deterministic JSON for a parsed Draxl file.
- dump_
json_ source - Parses, validates, and emits deterministic JSON for a Draxl source string.
- format_
file - Canonically formats a parsed Draxl file.
- format_
source - Parses, validates, and canonically formats a Draxl source string.
- lower_
rust_ file - Lowers a validated Draxl file to ordinary Rust source.
- lower_
rust_ source - Parses, validates, and lowers Draxl source to ordinary Rust.
- parse_
and_ validate - Parses and validates a Draxl source string in one step.
- parse_
file - Parses a Draxl source string into the typed AST.
- validate_
file - Validates a parsed Draxl file.
Type Aliases§
- Result
- Convenience result type for
draxlworkflows.