mirror of
https://github.com/astral-sh/ruff.git
synced 2025-12-23 09:19:58 +00:00
Move Token, TokenKind and Tokens to ruff-python-ast (#21760)
This commit is contained in:
parent
508c0a0861
commit
515de2d062
80 changed files with 1484 additions and 1492 deletions
|
|
@ -3,7 +3,7 @@ use std::ops::{Deref, DerefMut};
|
|||
|
||||
use ruff_formatter::{Buffer, FormatContext, GroupId, IndentWidth, SourceCode};
|
||||
use ruff_python_ast::str::Quote;
|
||||
use ruff_python_parser::Tokens;
|
||||
use ruff_python_ast::token::Tokens;
|
||||
|
||||
use crate::PyFormatOptions;
|
||||
use crate::comments::Comments;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use std::slice::Iter;
|
|||
use ruff_formatter::{FormatError, write};
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::Stmt;
|
||||
use ruff_python_parser::{self as parser, TokenKind};
|
||||
use ruff_python_ast::token::{Token as AstToken, TokenKind};
|
||||
use ruff_python_trivia::lines_before;
|
||||
use ruff_source_file::LineRanges;
|
||||
use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
|
|
@ -770,7 +770,7 @@ impl Format<PyFormatContext<'_>> for FormatVerbatimStatementRange {
|
|||
}
|
||||
|
||||
struct LogicalLinesIter<'a> {
|
||||
tokens: Iter<'a, parser::Token>,
|
||||
tokens: Iter<'a, AstToken>,
|
||||
// The end of the last logical line
|
||||
last_line_end: TextSize,
|
||||
// The position where the content to lex ends.
|
||||
|
|
@ -778,7 +778,7 @@ struct LogicalLinesIter<'a> {
|
|||
}
|
||||
|
||||
impl<'a> LogicalLinesIter<'a> {
|
||||
fn new(tokens: Iter<'a, parser::Token>, verbatim_range: TextRange) -> Self {
|
||||
fn new(tokens: Iter<'a, AstToken>, verbatim_range: TextRange) -> Self {
|
||||
Self {
|
||||
tokens,
|
||||
last_line_end: verbatim_range.start(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue