cl-lexer: switch to unicode-ident crate, since a dependency of cl-repl depends on it.
This commit is contained in:
parent
a07312bf92
commit
9cae7e4eb8
@ -10,4 +10,4 @@ publish.workspace = true
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
cl-token = { path = "../cl-token" }
|
cl-token = { path = "../cl-token" }
|
||||||
cl-structures = { path = "../cl-structures" }
|
cl-structures = { path = "../cl-structures" }
|
||||||
unicode-xid = "0.2.4"
|
unicode-ident = "1.0.12"
|
||||||
|
@ -7,7 +7,7 @@ use std::{
|
|||||||
iter::Peekable,
|
iter::Peekable,
|
||||||
str::{Chars, FromStr},
|
str::{Chars, FromStr},
|
||||||
};
|
};
|
||||||
use unicode_xid::UnicodeXID;
|
use unicode_ident::*;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
@ -128,7 +128,7 @@ impl<'t> Lexer<'t> {
|
|||||||
'"' => self.consume()?.string(),
|
'"' => self.consume()?.string(),
|
||||||
'\'' => self.consume()?.character(),
|
'\'' => self.consume()?.character(),
|
||||||
'_' => self.identifier(),
|
'_' => self.identifier(),
|
||||||
i if i.is_xid_start() => self.identifier(),
|
i if is_xid_start(i) => self.identifier(),
|
||||||
e => {
|
e => {
|
||||||
let err = Err(Error::unexpected_char(e, self.line(), self.col()));
|
let err = Err(Error::unexpected_char(e, self.line(), self.col()));
|
||||||
let _ = self.consume();
|
let _ = self.consume();
|
||||||
@ -339,7 +339,7 @@ impl<'t> Lexer<'t> {
|
|||||||
}
|
}
|
||||||
fn xid_start(&mut self) -> LResult<char> {
|
fn xid_start(&mut self) -> LResult<char> {
|
||||||
match self.peek()? {
|
match self.peek()? {
|
||||||
xid if xid == '_' || xid.is_xid_start() => {
|
xid if xid == '_' || is_xid_start(xid) => {
|
||||||
self.consume()?;
|
self.consume()?;
|
||||||
Ok(xid)
|
Ok(xid)
|
||||||
}
|
}
|
||||||
@ -348,7 +348,7 @@ impl<'t> Lexer<'t> {
|
|||||||
}
|
}
|
||||||
fn xid_continue(&mut self) -> LResult<char> {
|
fn xid_continue(&mut self) -> LResult<char> {
|
||||||
match self.peek()? {
|
match self.peek()? {
|
||||||
xid if xid.is_xid_continue() => {
|
xid if is_xid_continue(xid) => {
|
||||||
self.consume()?;
|
self.consume()?;
|
||||||
Ok(xid)
|
Ok(xid)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user