From 9cae7e4eb8fd9fc8b25bd830c99d5f505afa10ba Mon Sep 17 00:00:00 2001 From: John Date: Fri, 1 Mar 2024 04:11:38 -0600 Subject: [PATCH] cl-lexer: switch to unicode-ident crate, since a dependency of cl-repl depends on it. --- cl-lexer/Cargo.toml | 2 +- cl-lexer/src/lib.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cl-lexer/Cargo.toml b/cl-lexer/Cargo.toml index 8267f5f..42c8d42 100644 --- a/cl-lexer/Cargo.toml +++ b/cl-lexer/Cargo.toml @@ -10,4 +10,4 @@ publish.workspace = true [dependencies] cl-token = { path = "../cl-token" } cl-structures = { path = "../cl-structures" } -unicode-xid = "0.2.4" +unicode-ident = "1.0.12" diff --git a/cl-lexer/src/lib.rs b/cl-lexer/src/lib.rs index a15aacb..5ac2ecd 100644 --- a/cl-lexer/src/lib.rs +++ b/cl-lexer/src/lib.rs @@ -7,7 +7,7 @@ use std::{ iter::Peekable, str::{Chars, FromStr}, }; -use unicode_xid::UnicodeXID; +use unicode_ident::*; #[cfg(test)] mod tests; @@ -128,7 +128,7 @@ impl<'t> Lexer<'t> { '"' => self.consume()?.string(), '\'' => self.consume()?.character(), '_' => self.identifier(), - i if i.is_xid_start() => self.identifier(), + i if is_xid_start(i) => self.identifier(), e => { let err = Err(Error::unexpected_char(e, self.line(), self.col())); let _ = self.consume(); @@ -339,7 +339,7 @@ impl<'t> Lexer<'t> { } fn xid_start(&mut self) -> LResult { match self.peek()? { - xid if xid == '_' || xid.is_xid_start() => { + xid if xid == '_' || is_xid_start(xid) => { self.consume()?; Ok(xid) } @@ -348,7 +348,7 @@ impl<'t> Lexer<'t> { } fn xid_continue(&mut self) -> LResult { match self.peek()? { - xid if xid.is_xid_continue() => { + xid if is_xid_continue(xid) => { self.consume()?; Ok(xid) }