Files
codeql/python/extractor/tests/parser/collections.py
Taus ef60b730ea Python: Fix parenthesized tuple parser bug
We were writing the `parenthesised` attribute twice on tuples, once
because of the explicit parenthetisation, and once because all non-empty
tuples are parenthesised. This made `tree-sitter-graph` unhappy.

To fix this, we now explicitly check whether a tuple is already
parenthesised, and do nothing if that is the case.
2024-10-28 14:49:45 +00:00

40 lines
201 B
Python

()
[]
{}
[1,2,3]
(4,5,6)
{7: 8, 9: 10, 11: 12}
{13, 14, 15}
a = {x:y}
b = {z:w, **a}
c = [k,l,*m]
(o,)
(p,q,r,)
s,
t, u,
(#comment
v, w
#comment
)
(#comment
x, y,
#comment
)
((z,))