mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-19 16:50:45 +00:00
Rename ruff_python_whitespace
to ruff_python_trivia
(#5886)
## Summary This crate now contains utilities for dealing with trivia more broadly: whitespace, newlines, "simple" trivia lexing, etc. So renaming it to reflect its increased responsibilities. To avoid conflicts, I've also renamed `Token` and `TokenKind` to `SimpleToken` and `SimpleTokenKind`.
This commit is contained in:
parent
a75a6de577
commit
5f3da9955a
86 changed files with 360 additions and 353 deletions
|
@ -2,8 +2,8 @@ use ruff_text_size::{TextRange, TextSize};
|
|||
use rustpython_parser::ast::Ranged;
|
||||
|
||||
use ruff_formatter::{format_args, write, Argument, Arguments};
|
||||
use ruff_python_whitespace::{
|
||||
lines_after, skip_trailing_trivia, SimpleTokenizer, Token, TokenKind,
|
||||
use ruff_python_trivia::{
|
||||
lines_after, skip_trailing_trivia, SimpleToken, SimpleTokenKind, SimpleTokenizer,
|
||||
};
|
||||
|
||||
use crate::context::NodeLevel;
|
||||
|
@ -294,12 +294,12 @@ impl<'fmt, 'ast, 'buf> JoinCommaSeparatedBuilder<'fmt, 'ast, 'buf> {
|
|||
)
|
||||
.skip_trivia()
|
||||
// Skip over any closing parentheses belonging to the expression
|
||||
.find(|token| token.kind() != TokenKind::RParen);
|
||||
.find(|token| token.kind() != SimpleTokenKind::RParen);
|
||||
|
||||
matches!(
|
||||
first_token,
|
||||
Some(Token {
|
||||
kind: TokenKind::Comma,
|
||||
Some(SimpleToken {
|
||||
kind: SimpleTokenKind::Comma,
|
||||
..
|
||||
})
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue