ruff/crates/ruff_python_semantic/src
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
..
analyze Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
binding.rs Use separate structs for expression and statement tracking (#6351) 2023-08-07 15:27:42 +00:00
context.rs Remove separate ReferenceContext enum (#4631) 2023-05-24 15:12:38 +00:00
definition.rs Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
expressions.rs Use separate structs for expression and statement tracking (#6351) 2023-08-07 15:27:42 +00:00
globals.rs Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
lib.rs Use separate structs for expression and statement tracking (#6351) 2023-08-07 15:27:42 +00:00
model.rs Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
reference.rs Remove parser dependency from ruff-python-ast (#6096) 2023-07-26 17:47:22 +02:00
scope.rs Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
star_import.rs Move StarImport to its own module (#5186) 2023-06-20 13:12:46 -04:00
statements.rs Remove RefEquality (#6393) 2023-08-07 16:04:50 +00:00