Fix miscellaneous issues in await-outside-async detection (#14218)
## Summary Closes https://github.com/astral-sh/ruff/issues/14167.
This commit is contained in:
@@ -170,13 +170,21 @@ bitflags! {
|
||||
pub enum ScopeKind<'a> {
|
||||
Class(&'a ast::StmtClassDef),
|
||||
Function(&'a ast::StmtFunctionDef),
|
||||
Generator,
|
||||
Generator(GeneratorKind),
|
||||
Module,
|
||||
/// A Python 3.12+ [annotation scope](https://docs.python.org/3/reference/executionmodel.html#annotation-scopes)
|
||||
Type,
|
||||
Lambda(&'a ast::ExprLambda),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum GeneratorKind {
|
||||
Generator,
|
||||
ListComprehension,
|
||||
DictComprehension,
|
||||
SetComprehension,
|
||||
}
|
||||
|
||||
/// Id uniquely identifying a scope in a program.
|
||||
///
|
||||
/// Using a `u32` is sufficient because Ruff only supports parsing documents with a size of max `u32::max`
|
||||
|
||||
Reference in New Issue
Block a user