Closed
Description
Hi,
I made this macro:
macro_rules! is_match(
($value:expr, $pattern:pat) => (
match $value { $pattern => true, _ => false }
);
)
… which is pretty useful for constructs like if is_match!(next_char(), '0'..'9')
.
However this does not work with macro "alternatives": if is_match!(next_char(), 'a'..'z' | 'A'..'Z')
error: No rules expected the token: |
Is there a reason this couldn’t work?