mirror of
https://gitee.com/openharmony/third_party_rust_syn
synced 2024-11-23 16:00:10 +00:00
Replace unicode-xid with unicode-ident crate
This commit is contained in:
parent
fd1a51c69f
commit
be107389d4
@ -36,9 +36,9 @@ proc-macro = ["proc-macro2/proc-macro", "quote/proc-macro"]
|
||||
test = ["syn-test-suite/all-features"]
|
||||
|
||||
[dependencies]
|
||||
proc-macro2 = { version = "1.0.32", default-features = false }
|
||||
proc-macro2 = { version = "1.0.39", default-features = false }
|
||||
quote = { version = "1.0", optional = true, default-features = false }
|
||||
unicode-xid = "0.2"
|
||||
unicode-ident = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
anyhow = "1.0"
|
||||
|
@ -6,7 +6,6 @@ use crate::lookahead;
|
||||
use crate::parse::{Parse, ParseStream, Result};
|
||||
#[cfg(feature = "parsing")]
|
||||
use crate::token::Token;
|
||||
use unicode_xid::UnicodeXID;
|
||||
|
||||
pub use proc_macro2::Ident;
|
||||
|
||||
@ -90,11 +89,11 @@ impl From<Token![_]> for Ident {
|
||||
pub fn xid_ok(symbol: &str) -> bool {
|
||||
let mut chars = symbol.chars();
|
||||
let first = chars.next().unwrap();
|
||||
if !(first == '_' || UnicodeXID::is_xid_start(first)) {
|
||||
if !(first == '_' || unicode_ident::is_xid_start(first)) {
|
||||
return false;
|
||||
}
|
||||
for ch in chars {
|
||||
if !UnicodeXID::is_xid_continue(ch) {
|
||||
if !unicode_ident::is_xid_continue(ch) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -310,7 +310,6 @@
|
||||
))]
|
||||
extern crate proc_macro;
|
||||
extern crate proc_macro2;
|
||||
extern crate unicode_xid;
|
||||
|
||||
#[cfg(feature = "printing")]
|
||||
extern crate quote;
|
||||
|
Loading…
Reference in New Issue
Block a user