Skip to main content

Crate draxl

Crate draxl 

Source
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.
LowerLanguage
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 draxl workflows.