Expand description
Some useful functions on proc_macro and proc_macro2 types
E.g. pushing tokens onto TokenStream and testing
for specific punctuation on TokenTree and Punct
It also adds the assert_tokens! and assert_expansion! macros to
improve unit testability for proc-macros.
Macros§
- assert_
expansion parser - Allows simple unit testing of proc macro implementations.
- assert_
tokens parser - Asserts that the
lhsmatches the tokens wrapped in braces on therhs.
Structs§
- Token
Parser parser - Wrapper for
TokenStream::into_iterallowing not only to iterate on tokens but also to parse simple structures like types or expressions, though it does not make any claims about their correctness.
Traits§
- Delimited
- Trait to test for delimiters of groups
- Token
Stream2 Ext proc-macro2 - Generic extensions for
proc_macro2::TokenStream - Token
Stream Ext proc-macro - Generic extensions for
proc_macro::TokenStream - Token
Tree2 Ext proc-macro2 - Generic extensions for
proc_macro2::TokenTree - Token
Tree Ext proc-macro - Generic extensions for
proc_macro::TokenTree - Token
Tree Literal - Trait to parse literals
- Token
Tree Punct - Trait to test for punctuation