Improve readability of the parser code

This commit is contained in:
Pavan Kumar Sunkara 2024-03-06 21:09:30 +00:00
parent 00a0125372
commit 2a41b2cd94
10 changed files with 38 additions and 63 deletions

View file

@ -250,12 +250,9 @@ impl<'t> Parser<'t> {
/// Create an error node and consume the next token.
pub(crate) fn err_recover(&mut self, message: &str, recovery: TokenSet) {
match self.current() {
T!['{'] | T!['}'] => {
self.error(message);
return;
}
_ => (),
if matches!(self.current(), T!['{'] | T!['}']) {
self.error(message);
return;
}
if self.at_ts(recovery) {