mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
formatter: multi char tokens in SimpleTokenizer (#5610)
This commit is contained in:
parent
52b22ceb6e
commit
1e894f328c
8 changed files with 209 additions and 33 deletions
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
source: crates/ruff_python_formatter/src/trivia.rs
|
||||
expression: test_case.tokens()
|
||||
---
|
||||
[
|
||||
Token {
|
||||
kind: Other,
|
||||
range: 0..2,
|
||||
},
|
||||
]
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
source: crates/ruff_python_formatter/src/trivia.rs
|
||||
expression: test_case.tokens()
|
||||
---
|
||||
[
|
||||
Token {
|
||||
kind: Other,
|
||||
range: 0..1,
|
||||
},
|
||||
Token {
|
||||
kind: Bogus,
|
||||
range: 1..2,
|
||||
},
|
||||
Token {
|
||||
kind: Bogus,
|
||||
range: 2..3,
|
||||
},
|
||||
]
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
source: crates/ruff_python_formatter/src/trivia.rs
|
||||
expression: test_case.tokens()
|
||||
---
|
||||
[
|
||||
Token {
|
||||
kind: If,
|
||||
range: 0..2,
|
||||
},
|
||||
Token {
|
||||
kind: Whitespace,
|
||||
range: 2..3,
|
||||
},
|
||||
Token {
|
||||
kind: In,
|
||||
range: 3..5,
|
||||
},
|
||||
Token {
|
||||
kind: Whitespace,
|
||||
range: 5..6,
|
||||
},
|
||||
Token {
|
||||
kind: Else,
|
||||
range: 6..10,
|
||||
},
|
||||
Token {
|
||||
kind: Whitespace,
|
||||
range: 10..11,
|
||||
},
|
||||
Token {
|
||||
kind: Match,
|
||||
range: 11..16,
|
||||
},
|
||||
]
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
source: crates/ruff_python_formatter/src/trivia.rs
|
||||
expression: test_case.tokens()
|
||||
---
|
||||
[
|
||||
Token {
|
||||
kind: Other,
|
||||
range: 0..6,
|
||||
},
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue