semgrep / pfff

pfff is mainly an OCaml API to write static analysis, dynamic analysis, code visualizations, code navigations, or style-preserving source-to-source transformations such as refactorings on source code.
https://semgrep.dev
Other
186 stars 29 forks source link

python: Parse tuples inside array (etc.) accesses #550

Closed nmote closed 2 years ago

nmote commented 2 years ago

Python parses x[1, 2] and x[(1, 2)] into the same AST. pfff should too.

This addresses the (presumably) more normal case where each tuple element is an ordinary expression. However, individual tuple elements can also be slices. I did not change the behavior of the parser in cases where one or more of these elements is a slice. See comments for more information.

Security