macro_rules! extract_macro_single_unnamed_arg { ($db:expr, $syntax:expr, $pattern:pat) => { ... }; }
Expand description
Macro to extract a single unnamed argument of an inline macro. Gets the pattern for the allowed bracket types, and returns the argument expression.
Example usage (allowing ()
or {}
brackets):
let arg = extract_macro_single_unnamed_arg!(
db,
syntax,
ast::WrappedArgList::ParenthesizedArgList() | ast::WrappedArgList::BracedArgList()
);