mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-20 02:20:25 +00:00
Emit LexError
for dedent to incorrect level (#7638)
This commit is contained in:
parent
10e35e38d7
commit
8ce138760a
5 changed files with 126 additions and 13 deletions
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
source: crates/ruff_python_parser/src/lexer.rs
|
||||
expression: tokens
|
||||
---
|
||||
[
|
||||
Ok(
|
||||
(
|
||||
If,
|
||||
0..2,
|
||||
),
|
||||
),
|
||||
Ok(
|
||||
(
|
||||
True,
|
||||
3..7,
|
||||
),
|
||||
),
|
||||
Ok(
|
||||
(
|
||||
Colon,
|
||||
7..8,
|
||||
),
|
||||
),
|
||||
Ok(
|
||||
(
|
||||
Newline,
|
||||
8..9,
|
||||
),
|
||||
),
|
||||
Ok(
|
||||
(
|
||||
Indent,
|
||||
9..13,
|
||||
),
|
||||
),
|
||||
Ok(
|
||||
(
|
||||
Pass,
|
||||
13..17,
|
||||
),
|
||||
),
|
||||
Ok(
|
||||
(
|
||||
Newline,
|
||||
17..18,
|
||||
),
|
||||
),
|
||||
Err(
|
||||
LexicalError {
|
||||
error: IndentationError,
|
||||
location: 20,
|
||||
},
|
||||
),
|
||||
Ok(
|
||||
(
|
||||
Pass,
|
||||
20..24,
|
||||
),
|
||||
),
|
||||
Ok(
|
||||
(
|
||||
Newline,
|
||||
24..24,
|
||||
),
|
||||
),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue