It’s suprising for me to find that ident in macros has ambiguity with keywords:
macro_rules! idents_followed_by_keyword {
($($slot:ident,)+ else) => ($(let $slot = 0;)+);
}
fn main() {
idents_followed_by_keyword!(_a, else);
}
This fails compilation with:
error: local ambiguity: multiple parsing options: built-in NTs ident ('slot') or 1 other options.
As keywords cannot be used in place of identifiers, would it make sense to fix the matcher? This would allow more useful repeating syntaxes in macros, without a need to put parentheses or other cludges around places where identifiers are expected.