Crate wagon_macros

Source
Expand description

Procedural macros for use in the WAGon suite of libraries.

It would make more sense to put these in the wagon-utils crate. But Rust does not allow use to export procedural macros and regular functions from the same crate. So here we are.

Macros§

match_error
Automatically return a parse error if an unexpected token is encountered.
unspanned_tree
Given a hand-written, complete [wagon-parser::Wag] without any Span information, creates a proper one with dummy Span data.

Attribute Macros§

inherit_from_base
A procedural macro to extend lexers from a base lexer. Used by wagon-lexer::math::Math and wagon-lexer::productions::Productions.
new_unspanned
Given a struct/enum with wagon-parser::SpannableNode fields, creates constructors which do not require any SpannableNode wrapping.

Derive Macros§

TokenMapper
Derive macro for the wagon-parser::helpers::TokenMapper trait.
ValueAdd
Automatically derive this operation for wagon-value::Valueable types.
ValueDiv
Automatically derive this operation for wagon-value::Valueable types.
ValueMul
Automatically derive this operation for wagon-value::Valueable types.
ValueOps
Automatically derive all value operations
ValuePow
Automatically derive this operation for wagon-value::Valueable types.
ValueRem
Automatically derive this operation for wagon-value::Valueable types.
ValueSub
Automatically derive this operation for wagon-value::Valueable types.