mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fix Unicode 3.2.0 aliases, bump unicode_names2 (#9171)
Replaces: #9166 unicode_names2 fixed a bug with its aliases. Ironically, the bug caused a test in test_snippets.py to pass. Bumping unicode_names2 to 4.0.0 fixes the bug and thus the extra 3.2.0 test fails. I fixed the logic for name lookup for 3.2.0. Now the test correctly passes.
This commit is contained in:
1 parent
e64023020c
commit
cf6ca56789
3 files changed
+30
-17
No files matched your search
Generated
+14
-14
@@ -761,7 +761,7 @@ version = "3.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34"
|
||||
dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1296,9 +1296,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dirs"
|
||||
version = "6.0.0"
|
||||
version = "7.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e"
|
||||
checksum = "8d57d423b3c82e89b9a24ca3091fee61f456a26edbd28d26c65906f4bc1dcd8f"
|
||||
dependencies = [
|
||||
"dirs-sys",
|
||||
]
|
||||
@@ -1463,7 +1463,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2042,7 +2042,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46"
|
||||
dependencies = [
|
||||
"hermit-abi",
|
||||
"libc",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3562,7 +3562,7 @@ dependencies = [
|
||||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4070,7 +4070,7 @@ dependencies = [
|
||||
"icu_normalizer",
|
||||
"icu_properties",
|
||||
"rustpython-wtf8",
|
||||
"unicode_names2 3.1.0",
|
||||
"unicode_names2 4.0.0",
|
||||
"writeable",
|
||||
"zlib-rs",
|
||||
]
|
||||
@@ -4667,7 +4667,7 @@ dependencies = [
|
||||
"getrandom 0.4.3",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4887,12 +4887,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "unicode_names2"
|
||||
version = "3.1.0"
|
||||
version = "4.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "82c3e18d850bb6ebd57735e5654f0af65e572b05c2397e7b2b1a7c6a792cc29c"
|
||||
checksum = "8ba646312acace3c9ec35d7404b58214b6fbf17cbb0d040f35a88407c424447f"
|
||||
dependencies = [
|
||||
"phf 0.11.3",
|
||||
"unicode_names2_generator 3.1.0",
|
||||
"unicode_names2_generator 4.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4909,9 +4909,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "unicode_names2_generator"
|
||||
version = "3.1.0"
|
||||
version = "4.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "849744a58c479122ff24910d7ca57f312b62613ef0412dc327776ae6b235d16a"
|
||||
checksum = "3afbb72a8cff40859641ae4e56679215a15764e5c155a46f0f534611bdc08e0e"
|
||||
dependencies = [
|
||||
"phf_codegen",
|
||||
"rand 0.8.6",
|
||||
@@ -5161,7 +5161,7 @@ version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
||||
dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ log = { workspace = true }
|
||||
flame = { workspace = true, optional = true }
|
||||
|
||||
lexopt = "0.3"
|
||||
dirs = "6"
|
||||
dirs = "7"
|
||||
env_logger = "0.11"
|
||||
flamescope = { version = "0.1.2", optional = true }
|
||||
|
||||
@@ -317,7 +317,7 @@ icu_locale = "2"
|
||||
icu_properties = "2"
|
||||
icu_normalizer = "2"
|
||||
uuid = "1.23.2"
|
||||
unicode_names2 = { version = "3", default-features = false, features = ["no_std"] }
|
||||
unicode_names2 = { version = "4", default-features = false, features = ["no_std"] }
|
||||
widestring = "1.2.0"
|
||||
windows-sys = "0.61.2"
|
||||
wasm-bindgen = "0.2.106"
|
||||
|
||||
@@ -301,7 +301,20 @@ impl Ucd {
|
||||
if let Some(ch) = unicode_names2::character(search_name)
|
||||
.or_else(|| AlgorithmicName::check_name(search_name))
|
||||
{
|
||||
return self.membership(ch).then_some(LookupResult::Character(ch));
|
||||
if self.modern {
|
||||
return Some(LookupResult::Character(ch));
|
||||
}
|
||||
cold_path();
|
||||
|
||||
if !self.membership(ch) {
|
||||
return None;
|
||||
}
|
||||
|
||||
// 3.2.0 doesn't have aliases but unicode_names2 supports aliases so reject them.
|
||||
if lookup_alias(search_name).is_some() {
|
||||
return None;
|
||||
}
|
||||
return Some(LookupResult::Character(ch));
|
||||
}
|
||||
if !self.modern {
|
||||
return None;
|
||||
|
||||
Reference in new issue
Block a user