mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +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
|
@ -12,7 +12,7 @@ use rustpython_parser::ast::{
|
|||
use rustpython_parser::{lexer, Mode, Tok};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use ruff_python_whitespace::{is_python_whitespace, PythonWhitespace, UniversalNewlineIterator};
|
||||
use ruff_python_trivia::{is_python_whitespace, PythonWhitespace, UniversalNewlineIterator};
|
||||
|
||||
use crate::call_path::CallPath;
|
||||
use crate::source_code::{Indexer, Locator};
|
||||
|
|
|
@ -14,7 +14,7 @@ use ruff_text_size::{TextLen, TextRange, TextSize};
|
|||
use rustpython_ast::{Alias, Arg, ArgWithDefault};
|
||||
use rustpython_parser::ast::{self, ExceptHandler, Ranged, Stmt};
|
||||
|
||||
use ruff_python_whitespace::{is_python_whitespace, Cursor};
|
||||
use ruff_python_trivia::{is_python_whitespace, Cursor};
|
||||
|
||||
use crate::source_code::Locator;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ use rustpython_parser::ast::{
|
|||
TypeParamParamSpec, TypeParamTypeVar, TypeParamTypeVarTuple, WithItem,
|
||||
};
|
||||
|
||||
use ruff_python_whitespace::LineEnding;
|
||||
use ruff_python_trivia::LineEnding;
|
||||
|
||||
use crate::source_code::stylist::{Indentation, Quote, Stylist};
|
||||
|
||||
|
@ -1470,7 +1470,7 @@ mod tests {
|
|||
use rustpython_ast::Stmt;
|
||||
use rustpython_parser::Parse;
|
||||
|
||||
use ruff_python_whitespace::LineEnding;
|
||||
use ruff_python_trivia::LineEnding;
|
||||
|
||||
use crate::source_code::stylist::{Indentation, Quote};
|
||||
use crate::source_code::Generator;
|
||||
|
|
|
@ -6,7 +6,7 @@ use memchr::{memchr2, memrchr2};
|
|||
use once_cell::unsync::OnceCell;
|
||||
use ruff_text_size::{TextLen, TextRange, TextSize};
|
||||
|
||||
use ruff_python_whitespace::find_newline;
|
||||
use ruff_python_trivia::find_newline;
|
||||
|
||||
use crate::source_code::{LineIndex, OneIndexed, SourceCode, SourceLocation};
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::fmt;
|
|||
use std::ops::Deref;
|
||||
|
||||
use once_cell::unsync::OnceCell;
|
||||
use ruff_python_whitespace::{find_newline, LineEnding};
|
||||
use ruff_python_trivia::{find_newline, LineEnding};
|
||||
use rustpython_literal::escape::Quote as StrQuote;
|
||||
use rustpython_parser::lexer::LexResult;
|
||||
use rustpython_parser::Tok;
|
||||
|
@ -166,7 +166,7 @@ mod tests {
|
|||
use rustpython_parser::lexer::lex;
|
||||
use rustpython_parser::Mode;
|
||||
|
||||
use ruff_python_whitespace::{find_newline, LineEnding};
|
||||
use ruff_python_trivia::{find_newline, LineEnding};
|
||||
|
||||
use crate::source_code::stylist::{Indentation, Quote};
|
||||
use crate::source_code::{Locator, Stylist};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use ruff_text_size::{TextRange, TextSize};
|
||||
use rustpython_parser::ast::Ranged;
|
||||
|
||||
use ruff_python_whitespace::is_python_whitespace;
|
||||
use ruff_python_trivia::is_python_whitespace;
|
||||
|
||||
use crate::source_code::Locator;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue