Closed
Description
openedon Oct 24, 2015
Since code like
match {
pat | pat => …
}
is possible, there’s no problem if pat
is followed by a |
. It should be allowed in macro so e.g.
macro_rules! eat_token {
($s: ident, $($p: pat)|+) => {
match $s.current.t {
$($p)|+ => {
try!($s.bump());
Ok(())
}
_ => $s.unexpected()
}
}
}
//used like
eat_token!(self, TokenThis(_) | TokenThat(_))
is possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment