Migrate "invalid literal suffix" diagnostic to diagnostic structs

This commit is contained in:
Xiretza 2022-09-15 10:12:09 +02:00
parent ab7c7dc7ce
commit 6ae7a30927
8 changed files with 83 additions and 65 deletions

View file

@ -1147,7 +1147,9 @@ impl<'a> Parser<'a> {
fn parse_field_name(&mut self) -> PResult<'a, Ident> {
if let token::Literal(token::Lit { kind: token::Integer, symbol, suffix }) = self.token.kind
{
self.expect_no_suffix(self.token.span, "a tuple index", suffix);
if let Some(suffix) = suffix {
self.expect_no_tuple_index_suffix(self.token.span, suffix);
}
self.bump();
Ok(Ident::new(symbol, self.prev_token.span))
} else {