File tree Expand file tree Collapse file tree 1 file changed +1
-29
lines changed
Expand file tree Collapse file tree 1 file changed +1
-29
lines changed Original file line number Diff line number Diff line change 795795;;;;;; DictComp (`{a: b for c in d if e}`)
796796; See GeneratorExp for details.
797797
798- (dictionary_comprehension
799- body: (pair
800- key: (_) @_key
801- value: (_) @_value
802- )
803- ) @genexpr
798+ (dictionary_comprehension) @genexpr
804799{
805800 ; Synthesize the `genexpr` function
806801 let @genexpr.fun = (ast-node @genexpr "Function")
824819 attr (@genexpr.arg_use) ctx = "load"
825820}
826821
827- ; DictComp with unpacking (PEP 798): `{**d for d in dicts}`
828- (dictionary_comprehension
829- body: (dictionary_splat)
830- ) @genexpr
831- {
832- let @genexpr.fun = (ast-node @genexpr "Function")
833- attr (@genexpr.node) function = @genexpr.fun
834- attr (@genexpr.fun) name = "dictcomp"
835-
836- let @genexpr.arg = (ast-node @genexpr "Name")
837- attr (@genexpr.arg) variable = ".0"
838- attr (@genexpr.arg) ctx = "param"
839-
840- edge @genexpr.fun -> @genexpr.arg
841- attr (@genexpr.fun -> @genexpr.arg) args = 0
842- attr (@genexpr.fun) kwonlyargs = #null
843- attr (@genexpr.fun) kwarg = #null
844-
845- let @genexpr.arg_use = (ast-node @genexpr "Name")
846- attr (@genexpr.arg_use) variable = ".0"
847- attr (@genexpr.arg_use) ctx = "load"
848- }
849-
850822;;;;;; End of DictComp (`{a: b for c in d if e}`)
851823
852824;;;;;; GeneratorExp (`(a for b in c if d)`)
You can’t perform that action at this time.
0 commit comments