diff --git a/languages/tree-sitter-stack-graphs-python/src/stack-graphs.tsg b/languages/tree-sitter-stack-graphs-python/src/stack-graphs.tsg index 5fb407ae8..86f68d77c 100644 --- a/languages/tree-sitter-stack-graphs-python/src/stack-graphs.tsg +++ b/languages/tree-sitter-stack-graphs-python/src/stack-graphs.tsg @@ -158,6 +158,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n (generator_expression) (ellipsis) (list_splat) + (assignment) ; expression list (expression_list) diff --git a/languages/tree-sitter-stack-graphs-python/test/assignments.py b/languages/tree-sitter-stack-graphs-python/test/assignments.py new file mode 100644 index 000000000..83ed01b70 --- /dev/null +++ b/languages/tree-sitter-stack-graphs-python/test/assignments.py @@ -0,0 +1,11 @@ +x = 42 + +print(x) +# ^ defined: 1 + +y = z = 1337 + +print(x, y, z) +# ^ defined: 1 +# ^ defined: 6 +# ^ defined: 6