feat/refactor: improve errors in case of ident with number at start
This commit is contained in:
parent
8824994ccd
commit
252e0b3385
9 changed files with 68 additions and 45 deletions
|
@ -348,6 +348,10 @@ impl<'a> Parser<'a> {
|
|||
lo = self.token.span;
|
||||
}
|
||||
|
||||
if self.is_lit_bad_ident() {
|
||||
return Err(self.expected_ident_found());
|
||||
}
|
||||
|
||||
let pat = if self.check(&token::BinOp(token::And)) || self.token.kind == token::AndAnd {
|
||||
self.parse_pat_deref(expected)?
|
||||
} else if self.check(&token::OpenDelim(Delimiter::Parenthesis)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue