From 5a77985b39074f9f0ebff1a87d5a25d82cb9adae Mon Sep 17 00:00:00 2001 From: John Breaux Date: Wed, 31 Jan 2024 13:47:18 -0600 Subject: [PATCH] lexer: Fix bug that did not check the second character of identifiers. This also fixes one-character identifiers not being properly detected. --- src/lexer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lexer.rs b/src/lexer.rs index 992d785..447f28a 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -124,7 +124,7 @@ impl<'t> Lexer<'t> { '|' => self.then().emit(TokenKind::Bar), '}' => self.then().emit(TokenKind::CloseCurly), c if c.is_numeric() => self.number::(), - &c if is_xid_start(c) => self.then().identifier(), + &c if is_xid_start(c) => self.identifier(), c => todo!("Unrecognized character: {c}"), } }