Use crates.io unicode_names2 0.6.0 (#6478)

Update `unicode_names2` to the crates.io release 0.6.0, removing a git
dependency.
This commit is contained in:
konsti 2023-10-03 00:17:38 +02:00 committed by GitHub
parent f872c3bf0f
commit 3ccd1d580d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 89 additions and 9 deletions

View file

@ -23,7 +23,7 @@ is-macro = { workspace = true }
itertools = { workspace = true }
lalrpop-util = { version = "0.20.0", default-features = false }
unicode-ident = { workspace = true }
unicode_names2 = { version = "0.6.0", git = "https://github.com/youknowone/unicode_names2.git", rev = "4ce16aa85cbcdd9cc830410f1a72ef9a235f2fde" }
unicode_names2 = { workspace = true }
rustc-hash = { workspace = true }
static_assertions = "1.1.0"

View file

@ -1313,4 +1313,11 @@ u"foo" f"bar {baz} really" u"bar" "no"
.unwrap();
insta::assert_debug_snapshot!(parse_ast);
}
#[test]
fn test_unicode_aliases() {
// https://github.com/RustPython/RustPython/issues/4566
let parse_ast = parse_suite(r#"x = "\N{BACKSPACE}another cool trick""#, "<test>").unwrap();
insta::assert_debug_snapshot!(parse_ast);
}
}

View file

@ -0,0 +1,32 @@
---
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[
Assign(
StmtAssign {
range: 0..37,
targets: [
Name(
ExprName {
range: 0..1,
id: "x",
ctx: Store,
},
),
],
value: Constant(
ExprConstant {
range: 4..37,
value: Str(
StringConstant {
value: "\u{8}another cool trick",
unicode: false,
implicit_concatenated: false,
},
),
},
),
},
),
]