Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
`|` with the `pat` macro fragment specifier #4581
I made this macro:
… which is pretty useful for constructs like
Is there a reason this couldn’t work?
The macro tutorial has an interesting example similar to yours.
I've got this code working:
used like this:
I suspect your example doesn't work because
I concur with @lbonn's analysis that vertical-bar (
So either this is not-a-bug, or it should be interpreted as a request for a named macro-syntactic-class that contains
Issue #2234 is already filed for providing a formal (i.e. EBNF) definition for Rust's grammar, which would presumably help provide more direct answers for these sorts of questions. Since that's already filed, I'm going to close this bug as not-a-bug.