Ignore colon-after-lambda in compound statement rules (#2771)
This commit is contained in:
@@ -44,3 +44,5 @@ a: List[str] = []
|
||||
#:
|
||||
if a := 1:
|
||||
pass
|
||||
#:
|
||||
func = lambda x: x** 2 if cond else lambda x:x
|
||||
|
||||
@@ -182,6 +182,21 @@ pub fn compound_statements(lxr: &[LexResult]) -> Vec<Diagnostic> {
|
||||
}
|
||||
|
||||
match tok {
|
||||
Tok::Lambda => {
|
||||
// Reset.
|
||||
def = None;
|
||||
colon = None;
|
||||
class = None;
|
||||
elif = None;
|
||||
else_ = None;
|
||||
except = None;
|
||||
finally = None;
|
||||
for_ = None;
|
||||
if_ = None;
|
||||
try_ = None;
|
||||
while_ = None;
|
||||
with = None;
|
||||
}
|
||||
Tok::If => {
|
||||
if_ = Some((start, end));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user