mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Remove parser dependency from ruff-python-ast (#6096)
This commit is contained in:
parent
99127243f4
commit
2cf00fee96
658 changed files with 1714 additions and 1546 deletions
|
@ -16,6 +16,7 @@ license = { workspace = true }
|
|||
ruff_python_ast = { path = "../ruff_python_ast" }
|
||||
ruff_python_stdlib = { path = "../ruff_python_stdlib" }
|
||||
ruff_text_size = { workspace = true }
|
||||
ruff_source_file = { path = "../ruff_source_file" }
|
||||
ruff_index = { path = "../ruff_index" }
|
||||
|
||||
bitflags = { workspace = true }
|
||||
|
@ -23,4 +24,5 @@ is-macro = { workspace = true }
|
|||
num-traits = { workspace = true }
|
||||
rustc-hash = { workspace = true }
|
||||
rustpython-parser = { workspace = true }
|
||||
rustpython-ast = { workspace = true }
|
||||
smallvec = { workspace = true }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::cmp::Ordering;
|
||||
use std::iter;
|
||||
|
||||
use rustpython_parser::ast::{self, ExceptHandler, Stmt};
|
||||
use rustpython_ast::{self as ast, ExceptHandler, Stmt};
|
||||
|
||||
use crate::node::{NodeId, Nodes};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use rustpython_parser::ast::Decorator;
|
||||
use rustpython_ast::Decorator;
|
||||
|
||||
use ruff_python_ast::call_path::from_qualified_name;
|
||||
use ruff_python_ast::helpers::map_callable;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use rustpython_parser::ast::{self, Expr, Keyword};
|
||||
use rustpython_ast::{self as ast, Expr, Keyword};
|
||||
|
||||
use ruff_python_ast::call_path::{collect_call_path, from_qualified_name};
|
||||
use ruff_python_ast::helpers::{find_keyword, is_const_true};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! Analysis rules to perform basic type inference on individual expressions.
|
||||
|
||||
use rustpython_ast::{Constant, Expr};
|
||||
use rustpython_parser::ast;
|
||||
use rustpython_parser::ast::{Constant, Expr};
|
||||
|
||||
/// An extremely simple type inference system for individual expressions.
|
||||
///
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! Analysis rules for the `typing` module.
|
||||
|
||||
use num_traits::identities::Zero;
|
||||
use rustpython_parser::ast::{self, Constant, Expr, Operator};
|
||||
use rustpython_ast::{self as ast, Constant, Expr, Operator};
|
||||
|
||||
use ruff_python_ast::call_path::{from_qualified_name, from_unqualified_name, CallPath};
|
||||
use ruff_python_ast::helpers::is_const_false;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::path::Path;
|
||||
|
||||
use rustpython_parser::ast::{self, Decorator, Stmt};
|
||||
use rustpython_ast::{self as ast, Decorator, Stmt};
|
||||
|
||||
use ruff_python_ast::call_path::{collect_call_path, CallPath};
|
||||
use ruff_python_ast::helpers::map_callable;
|
||||
|
|
|
@ -2,10 +2,10 @@ use std::ops::{Deref, DerefMut};
|
|||
|
||||
use bitflags::bitflags;
|
||||
use ruff_text_size::TextRange;
|
||||
use rustpython_parser::ast::Ranged;
|
||||
use rustpython_ast::Ranged;
|
||||
|
||||
use ruff_index::{newtype_index, IndexSlice, IndexVec};
|
||||
use ruff_python_ast::source_code::Locator;
|
||||
use ruff_source_file::Locator;
|
||||
|
||||
use crate::context::ExecutionContext;
|
||||
use crate::model::SemanticModel;
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::fmt::Debug;
|
|||
use std::ops::Deref;
|
||||
|
||||
use ruff_index::{newtype_index, IndexSlice, IndexVec};
|
||||
use rustpython_parser::ast::{self, Stmt};
|
||||
use rustpython_ast::{self as ast, Stmt};
|
||||
|
||||
use crate::analyze::visibility::{
|
||||
class_visibility, function_visibility, method_visibility, ModuleSource, Visibility,
|
||||
|
|
|
@ -6,8 +6,8 @@ use std::ops::Index;
|
|||
|
||||
use ruff_text_size::TextRange;
|
||||
use rustc_hash::FxHashMap;
|
||||
use rustpython_ast::Stmt;
|
||||
use rustpython_parser::ast;
|
||||
use rustpython_parser::ast::Stmt;
|
||||
|
||||
use ruff_index::{newtype_index, IndexVec};
|
||||
use ruff_python_ast::statement_visitor::{walk_stmt, StatementVisitor};
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::path::Path;
|
|||
use bitflags::bitflags;
|
||||
use ruff_text_size::TextRange;
|
||||
use rustc_hash::FxHashMap;
|
||||
use rustpython_parser::ast::{Expr, Ranged, Stmt};
|
||||
use rustpython_ast::{Expr, Ranged, Stmt};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use ruff_python_ast::call_path::{collect_call_path, from_unqualified_name, CallPath};
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::ops::{Index, IndexMut};
|
|||
|
||||
use ruff_index::{newtype_index, IndexVec};
|
||||
use rustc_hash::FxHashMap;
|
||||
use rustpython_parser::ast::Stmt;
|
||||
use rustpython_ast::Stmt;
|
||||
|
||||
use ruff_python_ast::types::RefEquality;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use ruff_text_size::TextRange;
|
|||
use std::ops::Deref;
|
||||
|
||||
use ruff_index::{newtype_index, IndexSlice, IndexVec};
|
||||
use ruff_python_ast::source_code::Locator;
|
||||
use ruff_source_file::Locator;
|
||||
|
||||
use crate::context::ExecutionContext;
|
||||
use crate::scope::ScopeId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue