diff --git a/python/extractor/tsg-python/python.tsg b/python/extractor/tsg-python/python.tsg index e0aadd5432c..c832f7e6321 100644 --- a/python/extractor/tsg-python/python.tsg +++ b/python/extractor/tsg-python/python.tsg @@ -795,12 +795,7 @@ ;;;;;; DictComp (`{a: b for c in d if e}`) ; See GeneratorExp for details. -(dictionary_comprehension - body: (pair - key: (_) @_key - value: (_) @_value - ) -) @genexpr +(dictionary_comprehension) @genexpr { ; Synthesize the `genexpr` function let @genexpr.fun = (ast-node @genexpr "Function") @@ -824,29 +819,6 @@ attr (@genexpr.arg_use) ctx = "load" } -; DictComp with unpacking (PEP 798): `{**d for d in dicts}` -(dictionary_comprehension - body: (dictionary_splat) -) @genexpr -{ - let @genexpr.fun = (ast-node @genexpr "Function") - attr (@genexpr.node) function = @genexpr.fun - attr (@genexpr.fun) name = "dictcomp" - - let @genexpr.arg = (ast-node @genexpr "Name") - attr (@genexpr.arg) variable = ".0" - attr (@genexpr.arg) ctx = "param" - - edge @genexpr.fun -> @genexpr.arg - attr (@genexpr.fun -> @genexpr.arg) args = 0 - attr (@genexpr.fun) kwonlyargs = #null - attr (@genexpr.fun) kwarg = #null - - let @genexpr.arg_use = (ast-node @genexpr "Name") - attr (@genexpr.arg_use) variable = ".0" - attr (@genexpr.arg_use) ctx = "load" -} - ;;;;;; End of DictComp (`{a: b for c in d if e}`) ;;;;;; GeneratorExp (`(a for b in c if d)`)