mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
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.
40 lines
201 B
Python
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,))
|