array indexing and a bunch of other stuff

This commit is contained in:
nora 2022-06-26 15:44:39 +02:00
parent e7597dab07
commit 94229110cc
5 changed files with 172 additions and 20 deletions

View file

@ -51,7 +51,8 @@ where
lex: PeekMoreIterator<I>,
}
macro_rules! expect {
// HACK: It's called `_parser` as a workaround this being ambiguous with the `#[expect]` attribute
macro_rules! expect_parser {
($self:ident, $pat:pat) => {
match $self.next_t()? {
($pat, span) => span,
@ -68,6 +69,8 @@ macro_rules! expect {
};
}
use expect_parser as expect;
macro_rules! eat {
($self:ident, $pat:pat) => {
match $self.peek_t() {
@ -77,6 +80,8 @@ macro_rules! eat {
};
}
use eat;
/// Can be called for the start of a sequence of tokens that could be a type.
#[rustfmt::skip]
fn is_tok_start_of_ty(tok: &Tok<'_>) -> bool {