mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:15:12 +00:00
Fix panic with 8 in octal escape (#8356)
**Summary** The digits for an octal escape are 0 to 7, not 0 to 8, fixing the panic in #8355 **Test plan** Regression test parser fixture
This commit is contained in:
parent
b6c4074836
commit
daea870c3c
2 changed files with 38 additions and 1 deletions
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
source: crates/ruff_python_parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Assign(
|
||||
StmtAssign {
|
||||
range: 0..16,
|
||||
targets: [
|
||||
Name(
|
||||
ExprName {
|
||||
range: 0..4,
|
||||
id: "bold",
|
||||
ctx: Store,
|
||||
},
|
||||
),
|
||||
],
|
||||
value: StringLiteral(
|
||||
ExprStringLiteral {
|
||||
range: 7..16,
|
||||
value: "\u{3}8[1m",
|
||||
unicode: false,
|
||||
implicit_concatenated: false,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue