mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00
Remove Expr
postfix from ExprNamed
, ExprIf
, and ExprGenerator
(#10229)
The expression types in our AST are called `ExprYield`, `ExprAwait`, `ExprStringLiteral` etc, except `ExprNamedExpr`, `ExprIfExpr` and `ExprGenratorExpr`. This seems to align with [Python AST's naming](https://docs.python.org/3/library/ast.html) but feels inconsistent and excessive. This PR removes the `Expr` postfix from `ExprNamedExpr`, `ExprIfExpr`, and `ExprGeneratorExpr`.
This commit is contained in:
parent
8b749e1d4d
commit
184241f99a
64 changed files with 418 additions and 428 deletions
|
@ -20,7 +20,7 @@ impl Transformer for Relocator {
|
|||
Expr::BoolOp(nodes::ExprBoolOp { range, .. }) => {
|
||||
*range = self.range;
|
||||
}
|
||||
Expr::NamedExpr(nodes::ExprNamedExpr { range, .. }) => {
|
||||
Expr::Named(nodes::ExprNamed { range, .. }) => {
|
||||
*range = self.range;
|
||||
}
|
||||
Expr::BinOp(nodes::ExprBinOp { range, .. }) => {
|
||||
|
@ -32,7 +32,7 @@ impl Transformer for Relocator {
|
|||
Expr::Lambda(nodes::ExprLambda { range, .. }) => {
|
||||
*range = self.range;
|
||||
}
|
||||
Expr::IfExp(nodes::ExprIfExp { range, .. }) => {
|
||||
Expr::If(nodes::ExprIf { range, .. }) => {
|
||||
*range = self.range;
|
||||
}
|
||||
Expr::Dict(nodes::ExprDict { range, .. }) => {
|
||||
|
@ -50,7 +50,7 @@ impl Transformer for Relocator {
|
|||
Expr::DictComp(nodes::ExprDictComp { range, .. }) => {
|
||||
*range = self.range;
|
||||
}
|
||||
Expr::GeneratorExp(nodes::ExprGeneratorExp { range, .. }) => {
|
||||
Expr::Generator(nodes::ExprGenerator { range, .. }) => {
|
||||
*range = self.range;
|
||||
}
|
||||
Expr::Await(nodes::ExprAwait { range, .. }) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue