Skip to content

Commit

Permalink
Use crates.io unicode_names2 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Oct 2, 2023
1 parent c6d0bdd commit 7a8302d
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 4 deletions.
49 changes: 47 additions & 2 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ tracing = "0.1.37"
tracing-indicatif = "0.3.4"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
unicode-ident = "1.0.12"
# unicode_names2 = { version = "1.0.0" }
unicode_names2 = { git = "https://github.com/progval/unicode_names2" }
unicode-width = "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 7a8302d

Please sign in to comment.