mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Use the unicode-ident crate (#7212)
This commit is contained in:
parent
041cdb95e0
commit
f1a4eb9c28
8 changed files with 10 additions and 44 deletions
|
@ -23,8 +23,7 @@ itertools = { workspace = true }
|
|||
lalrpop-util = { version = "0.20.0", default-features = false }
|
||||
num-bigint = { workspace = true }
|
||||
num-traits = { workspace = true }
|
||||
unic-emoji-char = "0.9.0"
|
||||
unic-ucd-ident = { workspace = true }
|
||||
unicode-ident = { workspace = true }
|
||||
unicode_names2 = { version = "0.6.0", git = "https://github.com/youknowone/unicode_names2.git", rev = "4ce16aa85cbcdd9cc830410f1a72ef9a235f2fde" }
|
||||
rustc-hash = { workspace = true }
|
||||
static_assertions = "1.1.0"
|
||||
|
|
|
@ -36,8 +36,7 @@ use num_bigint::BigInt;
|
|||
use num_traits::{Num, Zero};
|
||||
use ruff_python_ast::IpyEscapeKind;
|
||||
use ruff_text_size::{TextLen, TextRange, TextSize};
|
||||
use unic_emoji_char::is_emoji_presentation;
|
||||
use unic_ucd_ident::{is_xid_continue, is_xid_start};
|
||||
use unicode_ident::{is_xid_continue, is_xid_start};
|
||||
|
||||
use crate::lexer::cursor::{Cursor, EOF_CHAR};
|
||||
use crate::lexer::indentation::{Indentation, Indentations};
|
||||
|
@ -597,15 +596,6 @@ impl<'source> Lexer<'source> {
|
|||
self.state = State::Other;
|
||||
|
||||
Ok((identifier, self.token_range()))
|
||||
} else if is_emoji_presentation(c) {
|
||||
self.state = State::Other;
|
||||
|
||||
Ok((
|
||||
Tok::Name {
|
||||
name: c.to_string(),
|
||||
},
|
||||
self.token_range(),
|
||||
))
|
||||
} else {
|
||||
Err(LexicalError {
|
||||
error: LexicalErrorType::UnrecognizedToken { tok: c },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue