1
Fork 0

refactor: refactor identifier parsing somewhat

This commit is contained in:
Ezra Shaw 2023-03-17 21:35:43 +13:00
parent 85123d2504
commit c9ddb73184
No known key found for this signature in database
GPG key ID: 67ABF16FB0ECD870
5 changed files with 31 additions and 23 deletions

View file

@ -1744,7 +1744,7 @@ impl<'a> Parser<'a> {
/// Parses a field identifier. Specialized version of `parse_ident_common`
/// for better diagnostics and suggestions.
fn parse_field_ident(&mut self, adt_ty: &str, lo: Span) -> PResult<'a, Ident> {
let (ident, is_raw) = self.ident_or_err()?;
let (ident, is_raw) = self.ident_or_err(true)?;
if !is_raw && ident.is_reserved() {
let snapshot = self.create_snapshot_for_diagnostic();
let err = if self.check_fn_front_matter(false, Case::Sensitive) {