ruff/crates/ruff_python_formatter/src/expression
Charlie Marsh daefa74e9a
Remove async AST node variants for with, for, and def (#6369)
## Summary

Per the suggestion in
https://github.com/astral-sh/ruff/discussions/6183, this PR removes
`AsyncWith`, `AsyncFor`, and `AsyncFunctionDef`, replacing them with an
`is_async` field on the non-async variants of those structs. Unlike an
interpreter, we _generally_ have identical handling for these nodes, so
separating them into distinct variants adds complexity from which we
don't really benefit. This can be seen below, where we get to remove a
_ton_ of code related to adding generic `Any*` wrappers, and a ton of
duplicate branches for these cases.

## Test Plan

`cargo test` is unchanged, apart from parser snapshots.
2023-08-07 16:36:02 +00:00
..
expr_attribute.rs Call chain formatting in fluent style (#6151) 2023-08-04 13:58:01 +00:00
expr_await.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_bin_op.rs Call chain formatting in fluent style (#6151) 2023-08-04 13:58:01 +00:00
expr_bool_op.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_call.rs Call chain formatting in fluent style (#6151) 2023-08-04 13:58:01 +00:00
expr_compare.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_constant.rs Replace .map_or(false, $closure) with .is_some_and(closure) (#6244) 2023-08-01 19:29:42 +02:00
expr_dict.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_dict_comp.rs Tweak breaking groups for comprehensions (#6321) 2023-08-04 14:00:54 +00:00
expr_formatted_value.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_generator_exp.rs Tweak breaking groups for comprehensions (#6321) 2023-08-04 14:00:54 +00:00
expr_if_exp.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_joined_str.rs format ExprJoinedStr (#5932) 2023-08-01 08:26:30 +02:00
expr_lambda.rs Fix formatting of lambda star arguments (#6257) 2023-08-02 19:31:20 +00:00
expr_line_magic.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_list.rs Generalize comment-after-bracket handling to lists, sets, etc. (#6320) 2023-08-04 01:28:05 +00:00
expr_list_comp.rs Tweak breaking groups for comprehensions (#6321) 2023-08-04 14:00:54 +00:00
expr_name.rs Remove Parse trait (#6235) 2023-08-01 18:35:03 +02:00
expr_named_expr.rs Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
expr_set.rs Generalize comment-after-bracket handling to lists, sets, etc. (#6320) 2023-08-04 01:28:05 +00:00
expr_set_comp.rs Tweak breaking groups for comprehensions (#6321) 2023-08-04 14:00:54 +00:00
expr_slice.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_starred.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_subscript.rs Call chain formatting in fluent style (#6151) 2023-08-04 13:58:01 +00:00
expr_tuple.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_unary_op.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_yield.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_yield_from.rs Add AnyExpressionYield to consolidate ExprYield and ExprYieldFrom (#6127) 2023-07-27 16:01:16 +00:00
mod.rs Call chain formatting in fluent style (#6151) 2023-08-04 13:58:01 +00:00
number.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
parentheses.rs Avoid hard line break after dangling open-parenthesis comments (#6380) 2023-08-07 14:15:32 +00:00
string.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00