Pull in RustPython parser (#6099)

This commit is contained in:
Micha Reiser 2023-07-27 11:29:11 +02:00 committed by GitHub
parent 86539c1fc5
commit 40f54375cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
779 changed files with 108400 additions and 2078 deletions

View file

@ -13,16 +13,16 @@ license = { workspace = true }
[lib]
[dependencies]
ruff_index = { path = "../ruff_index" }
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" }
ruff_text_size = { path = "../ruff_text_size" }
bitflags = { workspace = true }
is-macro = { workspace = true }
num-traits = { workspace = true }
rustc-hash = { workspace = true }
rustpython-parser = { workspace = true }
rustpython-ast = { workspace = true }
smallvec = { workspace = true }

View file

@ -1,7 +1,7 @@
use std::cmp::Ordering;
use std::iter;
use rustpython_ast::{self as ast, ExceptHandler, Stmt};
use ruff_python_ast::{self as ast, ExceptHandler, Stmt};
use crate::node::{NodeId, Nodes};

View file

@ -1,4 +1,4 @@
use rustpython_ast::Decorator;
use ruff_python_ast::Decorator;
use ruff_python_ast::call_path::from_qualified_name;
use ruff_python_ast::helpers::map_callable;

View file

@ -1,4 +1,4 @@
use rustpython_ast::{self as ast, Expr, Keyword};
use ruff_python_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};

View file

@ -1,7 +1,7 @@
//! Analysis rules to perform basic type inference on individual expressions.
use rustpython_ast::{Constant, Expr};
use rustpython_parser::ast;
use ruff_python_ast as ast;
use ruff_python_ast::{Constant, Expr};
/// An extremely simple type inference system for individual expressions.
///

View file

@ -1,7 +1,7 @@
//! Analysis rules for the `typing` module.
use num_traits::identities::Zero;
use rustpython_ast::{self as ast, Constant, Expr, Operator};
use ruff_python_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;

View file

@ -1,6 +1,6 @@
use std::path::Path;
use rustpython_ast::{self as ast, Decorator, Stmt};
use ruff_python_ast::{self as ast, Decorator, Stmt};
use ruff_python_ast::call_path::{collect_call_path, CallPath};
use ruff_python_ast::helpers::map_callable;

View file

@ -1,8 +1,8 @@
use std::ops::{Deref, DerefMut};
use bitflags::bitflags;
use ruff_python_ast::Ranged;
use ruff_text_size::TextRange;
use rustpython_ast::Ranged;
use ruff_index::{newtype_index, IndexSlice, IndexVec};
use ruff_source_file::Locator;

View file

@ -5,7 +5,7 @@ use std::fmt::Debug;
use std::ops::Deref;
use ruff_index::{newtype_index, IndexSlice, IndexVec};
use rustpython_ast::{self as ast, Stmt};
use ruff_python_ast::{self as ast, Stmt};
use crate::analyze::visibility::{
class_visibility, function_visibility, method_visibility, ModuleSource, Visibility,

View file

@ -4,10 +4,10 @@
use std::ops::Index;
use ruff_python_ast as ast;
use ruff_python_ast::Stmt;
use ruff_text_size::TextRange;
use rustc_hash::FxHashMap;
use rustpython_ast::Stmt;
use rustpython_parser::ast;
use ruff_index::{newtype_index, IndexVec};
use ruff_python_ast::statement_visitor::{walk_stmt, StatementVisitor};

View file

@ -1,9 +1,9 @@
use std::path::Path;
use bitflags::bitflags;
use ruff_python_ast::{Expr, Ranged, Stmt};
use ruff_text_size::TextRange;
use rustc_hash::FxHashMap;
use rustpython_ast::{Expr, Ranged, Stmt};
use smallvec::SmallVec;
use ruff_python_ast::call_path::{collect_call_path, from_unqualified_name, CallPath};

View file

@ -1,8 +1,8 @@
use std::ops::{Index, IndexMut};
use ruff_index::{newtype_index, IndexVec};
use ruff_python_ast::Stmt;
use rustc_hash::FxHashMap;
use rustpython_ast::Stmt;
use ruff_python_ast::types::RefEquality;

View file

@ -1,8 +1,8 @@
use std::ops::{Deref, DerefMut};
use bitflags::bitflags;
use ruff_python_ast as ast;
use rustc_hash::FxHashMap;
use rustpython_parser::ast;
use ruff_index::{newtype_index, Idx, IndexSlice, IndexVec};