lexer: Fix bug that did not check the second character of identifiers. This also fixes one-character identifiers not being properly detected.
This commit is contained in:
parent
b31295ad21
commit
5a77985b39
@ -124,7 +124,7 @@ impl<'t> Lexer<'t> {
|
|||||||
'|' => self.then().emit(TokenKind::Bar),
|
'|' => self.then().emit(TokenKind::Bar),
|
||||||
'}' => self.then().emit(TokenKind::CloseCurly),
|
'}' => self.then().emit(TokenKind::CloseCurly),
|
||||||
c if c.is_numeric() => self.number::<DEFAULT_BASE>(),
|
c if c.is_numeric() => self.number::<DEFAULT_BASE>(),
|
||||||
&c if is_xid_start(c) => self.then().identifier(),
|
&c if is_xid_start(c) => self.identifier(),
|
||||||
c => todo!("Unrecognized character: {c}"),
|
c => todo!("Unrecognized character: {c}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user