Expand description
Helper crate providing procedural macros for the Rust engine of hax.
Currently it provides the following.
- Macros for deriving groups of traits.
Most of the type from the AST have the same bounds, so that helps deduplicating a lot.
Also, the fact those derive groups are named is helpful: for instance for code generation
a simple
use derive_group_for_ast_base as derive_group_for_astcan change what is to be derived without any attribute manipulation.
Attribute Macrosยง
- derive_
group_ for_ ast - Derive the common derives for the hax engine AST.
This is a equivalent to
derive_group_for_ast_serializationandderive_group_for_ast_base. - derive_
group_ for_ ast_ base - Derive the basic necessary traits for nodes in the AST.
- derive_
group_ for_ ast_ serialization - Derive the necessary (de)serialization related traits for nodes in the AST.
- partial_
apply - An attribute procedural macro that creates a new
macro_rules!definition by partially applying an existing macro or function with a given token stream. - prepend_
associated_ functions_ with - Prepend the body any associated function with the given attribute payload.
- replace
- Replaces all occurrences of an identifier within the attached item.
- setup_
error_ handling_ struct - Adds a new field with a fresh name to an existing
structtype definition. The new field contains error handling and span information to be used with a visitor. This macro will also derive implementations ofhax_rust_engine::ast::visitors::wrappers::VisitorWithErrorsandhax_rust_engine::ast::HasSpanfor the struct. - setup_
printer_ struct - Adds a new field with a fresh name to an existing
structtype definition. The new field contains span information to be used with a printer. This macro will also derive implementations ofhax_rust_engine::printer::pretty_ast::HasContextualSpanfor the struct.