Expand description
Public facade for Draxl, an agent-native source annotation layer 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_merge as merge;pub use draxl_parser as parser;pub use draxl_patch as patch;pub use draxl_printer as printer;pub use draxl_rust as rust;pub use draxl_rust as lower_rust;pub use draxl_validate as validate;
Enums§
- Error
- Top-level error for public Draxl workflows.
- Lower
Language - Ordinary language a Draxl source file is intended to lower into.
Functions§
- apply_
patch - Applies a single structured patch operation.
- apply_
patch_ for_ language - Applies a single structured patch operation using the selected lower language.
- apply_
patch_ text - Parses, resolves, and applies textual patch ops in order.
- apply_
patch_ text_ for_ language - Parses, resolves, and applies textual patch ops in order using the selected lower language.
- apply_
patches - Applies multiple structured patch operations in order.
- apply_
patches_ for_ language - Applies multiple structured patch operations in order using the selected lower language.
- check_
conflicts - Checks both hard and semantic conflicts against the same base.
- check_
conflicts_ for_ language - Checks both hard and semantic conflicts against the same base using the selected lower language.
- check_
conflicts_ json - Checks both hard and semantic conflicts and emits JSON.
- check_
conflicts_ json_ for_ language - Checks both hard and semantic conflicts and emits JSON using the selected lower language.
- check_
hard_ conflicts - Checks whether two patch streams have hard conflicts against the same base.
- check_
hard_ conflicts_ for_ language - Checks whether two patch streams have hard conflicts against the same base using the selected lower language.
- check_
hard_ conflicts_ json - Checks whether two patch streams have hard conflicts and emits JSON.
- check_
hard_ conflicts_ json_ for_ language - Checks whether two patch streams have hard conflicts and emits JSON using the selected lower language.
- 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_
file_ for_ language - Canonically formats a parsed Draxl file using the selected lower language.
- format_
source - Parses, validates, and canonically formats a Draxl source string.
- format_
source_ for_ language - Parses, validates, and canonically formats a Draxl source string using the selected lower language.
- import_
rust_ source - Imports ordinary Rust source into canonical Draxl Rust-profile source.
- lower_
file_ for_ language - Lowers a validated Draxl file using the selected lower language.
- lower_
rust_ file - Lowers a validated Draxl file to ordinary Rust source.
- lower_
rust_ source - Parses, validates, and lowers Draxl source to ordinary Rust.
- lower_
source_ for_ language - Parses, validates, and lowers Draxl source using the selected lower language.
- parse_
and_ validate - Parses and validates a Draxl source string in one step.
- parse_
and_ validate_ for_ language - Parses and validates a Draxl source string using the selected lower language.
- parse_
file - Parses a Draxl source string into the typed AST.
- parse_
file_ for_ language - Parses a Draxl source string into the typed AST using the selected lower language.
- parse_
patch_ ops - Parses canonical textual patch ops into unresolved surface ops.
- resolve_
patch_ ops - Resolves textual patch ops against the current file.
- resolve_
patch_ ops_ for_ language - Resolves textual patch ops against the current file using the selected lower language.
- validate_
file - Validates a parsed Draxl file.
Type Aliases§
- Result
- Convenience result type for
draxlworkflows.