You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a91c586
Browse filesBrowse the repository at this point in the historyBrowse files
Python: Infer expression contexts in QL rather than in the extractor
Adds a simple recursive scheme for inferring expression contexts. This
means we no longer need to do this in the extractor, but the present
commit does not attempt to remove that code.
Overall this is an improvement to the readability of the code. Instead
of writing `py_expr_contexts(_, 2, foo)`, we can write
`foo.isDeleteContext()`.
I validated this by running the newly added `ExprContextParity` query on
`python/cpython`, where it had zero results (meaning all of the inferred
contexts match exactly to the ones generated by the extractor).
Finally, the `UselessClass` query used `ctx instanceof AugAssign`, which
never did anything in the first place since `AugAssign` isn't a valid
context type. I therefore refactored it to (presumably) capture the
original intent of also matching augmented assignments.
0 commit comments