Implement U016: Remove six compatibility code (#1013)

This commit is contained in:
Martin Lehoux 2022-12-15 20:16:58 +01:00 committed by GitHub
parent 27de342e75
commit d8b4b92733
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 1333 additions and 0 deletions

View file

@ -11,6 +11,16 @@ use rustpython_parser::lexer::Tok;
use crate::ast::types::Range;
use crate::SourceCodeLocator;
/// Create an `Expr` with default location from an `ExprKind`.
pub fn create_expr(node: ExprKind) -> Expr {
Expr::new(Location::default(), Location::default(), node)
}
/// Create a `Stmt` with a default location from a `StmtKind`.
pub fn create_stmt(node: StmtKind) -> Stmt {
Stmt::new(Location::default(), Location::default(), node)
}
fn collect_call_path_inner<'a>(expr: &'a Expr, parts: &mut Vec<&'a str>) {
match &expr.node {
ExprKind::Call { func, .. } => {