Skip to content

Commit

Permalink
Use crates.io unicode_names2 0.6.0 (#6478)
Browse files Browse the repository at this point in the history
Update `unicode_names2` to the crates.io release 0.6.0, removing a git
dependency.
  • Loading branch information
konstin authored Oct 2, 2023
1 parent f872c3b commit 3ccd1d5
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 9 deletions.
44 changes: 42 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ insta = { version = "1.33.0", feature = ["filters", "glob"] }
is-macro = { version = "0.3.0" }
itertools = { version = "0.11.0" }
log = { version = "0.4.17" }
memchr = "2.6.4"
memchr = { version = "2.6.4" }
once_cell = { version = "1.17.1" }
path-absolutize = { version = "3.1.1" }
proc-macro2 = { version = "1.0.67" }
Expand All @@ -45,11 +45,12 @@ syn = { version = "2.0.37" }
test-case = { version = "3.2.1" }
thiserror = { version = "1.0.49" }
toml = { version = "0.7.8" }
tracing = "0.1.37"
tracing-indicatif = "0.3.4"
tracing = { version = "0.1.37" }
tracing-indicatif = { version = "0.3.4" }
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
unicode-ident = "1.0.12"
unicode-width = "0.1.11"
unicode-ident = { version = "1.0.12" }
unicode_names2 = { version = "1.1.0" }
unicode-width = { version = "0.1.11" }
uuid = { version = "1.4.1", features = ["v4", "fast-rng", "macro-diagnostics", "js"] }
wsl = { version = "0.1.0" }

Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_linter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ thiserror = { workspace = true }
toml = { workspace = true }
typed-arena = { version = "2.0.2" }
unicode-width = { workspace = true }
unicode_names2 = { version = "0.6.0", git = "https://github.com/youknowone/unicode_names2.git", rev = "4ce16aa85cbcdd9cc830410f1a72ef9a235f2fde" }
unicode_names2 = { workspace = true }
wsl = { version = "0.1.0" }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_python_parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
7 changes: 7 additions & 0 deletions crates/ruff_python_parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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,
},
),
},
),
},
),
]

0 comments on commit 3ccd1d5

Please sign in to comment.