mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +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
|
@ -43,17 +43,17 @@ pub(crate) fn assignment_target(target: &Expr) -> Result<(), LexicalError> {
|
|||
};
|
||||
match *target {
|
||||
BoolOp(ref e) => Err(err(e.range.start())),
|
||||
NamedExpr(ref e) => Err(err(e.range.start())),
|
||||
Named(ref e) => Err(err(e.range.start())),
|
||||
BinOp(ref e) => Err(err(e.range.start())),
|
||||
UnaryOp(ref e) => Err(err(e.range.start())),
|
||||
Lambda(ref e) => Err(err(e.range.start())),
|
||||
IfExp(ref e) => Err(err(e.range.start())),
|
||||
If(ref e) => Err(err(e.range.start())),
|
||||
Dict(ref e) => Err(err(e.range.start())),
|
||||
Set(ref e) => Err(err(e.range.start())),
|
||||
ListComp(ref e) => Err(err(e.range.start())),
|
||||
SetComp(ref e) => Err(err(e.range.start())),
|
||||
DictComp(ref e) => Err(err(e.range.start())),
|
||||
GeneratorExp(ref e) => Err(err(e.range.start())),
|
||||
Generator(ref e) => Err(err(e.range.start())),
|
||||
Await(ref e) => Err(err(e.range.start())),
|
||||
Yield(ref e) => Err(err(e.range.start())),
|
||||
YieldFrom(ref e) => Err(err(e.range.start())),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue