mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
Pull in RustPython parser (#6099)
This commit is contained in:
parent
86539c1fc5
commit
40f54375cb
779 changed files with 108400 additions and 2078 deletions
|
@ -14,11 +14,13 @@ license = { workspace = true }
|
|||
|
||||
[dependencies]
|
||||
ruff_python_trivia = { path = "../ruff_python_trivia" }
|
||||
rustpython-parser = { workspace = true }
|
||||
ruff_text_size = { workspace = true }
|
||||
|
||||
ruff_python_ast = { path = "../ruff_python_ast" }
|
||||
ruff_python_parser = { path = "../ruff_python_parser" }
|
||||
ruff_source_file = { path = "../ruff_source_file" }
|
||||
ruff_text_size = { path = "../ruff_text_size" }
|
||||
|
||||
itertools = { workspace = true }
|
||||
rustpython-ast = { workspace = true }
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue