mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
upgrade lalrpop to 0.19.8
This commit is contained in:
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -878,9 +878,9 @@ checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7"
|
||||
|
||||
[[package]]
|
||||
name = "lalrpop-util"
|
||||
version = "0.19.7"
|
||||
version = "0.19.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6d265705249fe209280676d8f68887859fa42e1d34f342fc05bd47726a5e188"
|
||||
checksum = "bcf796c978e9b4d983414f4caedc9273aa33ee214c5b887bd55fde84c85d2dc4"
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
|
||||
@@ -14,7 +14,7 @@ phf_codegen = "0.10"
|
||||
|
||||
[dependencies]
|
||||
rustpython-ast = { path = "../ast" }
|
||||
lalrpop-util = "0.19.7"
|
||||
lalrpop-util = "0.19.8"
|
||||
log = "0.4.16"
|
||||
num-bigint = "0.4.3"
|
||||
num-traits = "0.2.14"
|
||||
|
||||
@@ -90,20 +90,15 @@ fn try_lalrpop(source: &str, target: &str) -> Result<(), ExitCode> {
|
||||
}
|
||||
|
||||
fn sha_equal(expected_sha3_str: &str, actual_sha3: &[u8; 32]) -> bool {
|
||||
// stupid stupid stupid hack. lalrpop outputs each byte as "{:x}" instead of "{:02x}"
|
||||
if expected_sha3_str.len() == 64 {
|
||||
let mut expected_sha3 = [0u8; 32];
|
||||
for (i, b) in expected_sha3.iter_mut().enumerate() {
|
||||
*b = u8::from_str_radix(&expected_sha3_str[i * 2..][..2], 16).unwrap();
|
||||
}
|
||||
*actual_sha3 == expected_sha3
|
||||
} else {
|
||||
let mut actual_sha3_str = String::new();
|
||||
for byte in actual_sha3 {
|
||||
write!(actual_sha3_str, "{byte:x}").unwrap();
|
||||
}
|
||||
actual_sha3_str == expected_sha3_str
|
||||
if expected_sha3_str.len() != 64 {
|
||||
panic!("lalrpop version? hash bug is fixed in 0.19.8");
|
||||
}
|
||||
|
||||
let mut expected_sha3 = [0u8; 32];
|
||||
for (i, b) in expected_sha3.iter_mut().enumerate() {
|
||||
*b = u8::from_str_radix(&expected_sha3_str[i * 2..][..2], 16).unwrap();
|
||||
}
|
||||
*actual_sha3 == expected_sha3
|
||||
}
|
||||
|
||||
fn gen_phf() {
|
||||
|
||||
Reference in New Issue
Block a user