-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-syntaxextArea: Syntax extensionsArea: Syntax extensionsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
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?
Metadata
Metadata
Assignees
Labels
A-syntaxextArea: Syntax extensionsArea: Syntax extensionsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.