File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,23 @@ def reify_ast(s):
1111 for s_dict in s :
1212 for k ,v in s_dict .items ():
1313 s_without_k = deepcopy (s_dict )
14- del s_without_k [k ]
15- print ('Reifying {}:{} with {}' .format (k , v , s_without_k ))
14+ #del s_without_k[k]
15+ print ('Reifying {}:{} with {}' .format (k , ast_dump_if_possible (v ),
16+ ast_dump_substitute (s_without_k )))
1617 try :
17- o = reify_object (v , s_without_k )
18+ v = reify_object (v , s_without_k )
19+ print ('Reified object {}' .format (k ))
1820 except AttributeError :
19- o = reify (v , s_without_k )
20- objects .append (o )
21- return [ast_dump_if_possible (o ) for o in objects ]
21+ v = reify (v , s_without_k )
22+ s_dict [k ] = v
23+ print ('Reified {} to {}' .format (k , ast_dump_if_possible (v ),
24+ s_without_k ))
25+ return s
2226
2327def ast_dump_if_possible (a ):
2428 if isinstance (a , ast .AST ):
2529 return ast .dump (a )
2630 return a
31+
32+ def ast_dump_substitute (s ):
33+ return {k : ast_dump_if_possible (v ) for k ,v in s .items ()}
You can’t perform that action at this time.
0 commit comments