mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 07:04:28 -05:00
Pull in RustPython parser (#6099)
This commit is contained in:
@@ -2,8 +2,8 @@ use itertools::Itertools;
|
||||
use std::fmt::{Debug, Formatter};
|
||||
use std::ops::Deref;
|
||||
|
||||
use ruff_python_parser::Tok;
|
||||
use ruff_text_size::TextRange;
|
||||
use rustpython_parser::Tok;
|
||||
|
||||
/// Stores the ranges of comments sorted by [`TextRange::start`] in increasing order. No two ranges are overlapping.
|
||||
#[derive(Clone)]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//! Struct used to index source code, to enable efficient lookup of tokens that
|
||||
//! are omitted from the AST (e.g., commented lines).
|
||||
|
||||
use ruff_python_ast::{Ranged, Stmt};
|
||||
use ruff_python_parser::lexer::LexResult;
|
||||
use ruff_python_parser::{StringKind, Tok};
|
||||
use ruff_python_trivia::{has_leading_content, has_trailing_content, is_python_whitespace};
|
||||
use ruff_text_size::{TextRange, TextSize};
|
||||
use rustpython_ast::{Ranged, Stmt};
|
||||
use rustpython_parser::lexer::LexResult;
|
||||
use rustpython_parser::{StringKind, Tok};
|
||||
|
||||
use super::comment_ranges::{CommentRanges, CommentRangesBuilder};
|
||||
use ruff_source_file::Locator;
|
||||
@@ -264,9 +264,9 @@ impl Indexer {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ruff_python_parser::lexer::LexResult;
|
||||
use ruff_python_parser::{lexer, Mode};
|
||||
use ruff_text_size::{TextRange, TextSize};
|
||||
use rustpython_parser::lexer::LexResult;
|
||||
use rustpython_parser::{lexer, Mode};
|
||||
|
||||
use crate::Indexer;
|
||||
use ruff_source_file::Locator;
|
||||
|
||||
Reference in New Issue
Block a user