Module macro_helpers

Module macro_helpers 

Source

Traits§

AsLegacyInlineMacro
Trait for converting inline macros with token tree syntax as the argument to legacy inline which must have a wrapped argument list syntax node.

Functions§

as_expr_macro_token_tree
Takes a token tree syntax node, which is assumed to be parsable as an expression (it assumes that the prefix is an expr, not the whole iterator), tries to parse it as such, and returns the result. The token tree iterator is consumed entirely. The resulting expression’s offset corresponds to the offset of the first token in the provided token tree.
token_tree_as_wrapped_arg_list
Takes a token tree syntax node, which is assumed to be parsable as a wrapped argument list, try to parse it as such and return the result.