Expand description
mbe
(short for Macro By Example) crate contains code for handling
macro_rules
macros. It uses TokenTree
(from tt
package) as the
interface, although it contains some code to bridge SyntaxNode
s and
TokenTree
s as well!
The tests for this functionality live in another crate:
hir_def::macro_expansion_tests::mbe
.
Structs§
- Declarative
Macro - This struct contains AST for a single
macro_rules
definition. What might be very confusing is that AST has almost exactly the same shape astt::TokenTree
, but there’s a crucial difference: in macro rules,$ident
and$()*
have special meaning (seeVar
andRepeat
data structures) - Delimiter
- Expand
Error - Punct
- Value
Result
Enums§
Functions§
Type Aliases§
- Expand
Result - Matched
ArmIndex - Index of the matched macro arm on successful expansion.