diff options
| author | Kevin Stevens <48657161+stevenskevin@users.noreply.github.com> | 2023-05-15 03:35:46 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-15 09:35:46 +0200 |
| commit | 156aef10c463f81ca0016583a9df83d7b8560e59 (patch) | |
| tree | 57c8b7b9fa113930a1abc07a4358afbda56cf511 /src/syntax | |
| parent | 0fcac6d27ebb92e7435ac71bfcc37eae07230f2e (diff) | |
Switch from unicode_xid to unicode_ident (#1208)
Diffstat (limited to 'src/syntax')
| -rw-r--r-- | src/syntax/lexer.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/syntax/lexer.rs b/src/syntax/lexer.rs index eb19d8d9..ee73a595 100644 --- a/src/syntax/lexer.rs +++ b/src/syntax/lexer.rs @@ -1,6 +1,6 @@ use ecow::{eco_format, EcoString}; +use unicode_ident::{is_xid_continue, is_xid_start}; use unicode_segmentation::UnicodeSegmentation; -use unicode_xid::UnicodeXID; use unscanny::Scanner; use super::{ErrorPos, SyntaxKind}; @@ -723,23 +723,23 @@ pub fn is_ident(string: &str) -> bool { /// Whether a character can start an identifier. #[inline] pub(crate) fn is_id_start(c: char) -> bool { - c.is_xid_start() || c == '_' + is_xid_start(c) || c == '_' } /// Whether a character can continue an identifier. #[inline] pub(crate) fn is_id_continue(c: char) -> bool { - c.is_xid_continue() || c == '_' || c == '-' + is_xid_continue(c) || c == '_' || c == '-' } /// Whether a character can start an identifier in math. #[inline] fn is_math_id_start(c: char) -> bool { - c.is_xid_start() + is_xid_start(c) } /// Whether a character can continue an identifier in math. #[inline] fn is_math_id_continue(c: char) -> bool { - c.is_xid_continue() && c != '_' + is_xid_continue(c) && c != '_' } |
