diff --git a/crates/ruff_python_parser/src/lexer.rs b/crates/ruff_python_parser/src/lexer.rs index 1dc686f5af76e..5e6b5b3160633 100644 --- a/crates/ruff_python_parser/src/lexer.rs +++ b/crates/ruff_python_parser/src/lexer.rs @@ -18,6 +18,7 @@ use ruff_python_ast::str_prefix::{ AnyStringPrefix, ByteStringPrefix, FStringPrefix, StringLiteralPrefix, }; use ruff_python_ast::{AnyStringFlags, Int, IpyEscapeKind, StringFlags}; +use ruff_python_trivia::is_python_whitespace; use ruff_text_size::{Ranged, TextLen, TextRange, TextSize}; use crate::error::FStringErrorType; @@ -1807,20 +1808,6 @@ fn is_identifier_continuation(c: char, identifier_is_ascii_only: &mut bool) -> b } } -/// Returns `true` for [whitespace](https://docs.python.org/3/reference/lexical_analysis.html#whitespace-between-tokens) -/// characters. -/// -/// This is the same as `ruff_python_trivia::is_python_whitespace` and is copied -/// here to avoid a circular dependency as `ruff_python_trivia` has a dev-dependency -/// on `ruff_python_lexer`. -const fn is_python_whitespace(c: char) -> bool { - matches!( - c, - // Space, tab, or form-feed - ' ' | '\t' | '\x0C' - ) -} - enum LexedText<'a> { Source { source: &'a str, range: TextRange }, Owned(String),