@@ -33,7 +33,6 @@ def node_from_range_new(root,atok,r,special = False,lenient = False):
3333 if  lenient :
3434 inside  =  lambda  x ,y : (y [0 ]<= x [0 ]<= y [1 ] and  y [0 ]<= x [1 ]<= y [1 ] and  not  y [0 ]== y [1 ]== 0 )
3535 generic_fix (root ,atok )
36-  # print(" the fields are now",root._fields) 
3736 for  child  in  ast .iter_child_nodes (root ):
3837 # print(" just to check something out",child,atok.get_text_range(child)) 
3938 # print(" and the child fields are ",child._fields) 
@@ -80,10 +79,8 @@ def node_from_range_old(root,atok, r ):
8079 inside  =  lambda  x ,y : (y [0 ]<= x [0 ]< y [1 ] and  y [0 ]< x [1 ]<= y [1 ])
8180 candidates  = ([(node ,atok .get_text_range (node )) for  node  in  ast .walk ( root  ) if  not  isinstance (node ,ast .Module ) 
8281 and  inside (r ,atok .get_text_range (node ))])
83-  print ("inside note from range \n " )
8482 for  x  in  candidates :
8583 print (x ,atok .get_text_range (x ))
86-  print ("outside note from range \n " ,min ( candidates  , key =  lambda  y  :(y [1 ][1 ]- y [1 ][0 ]) )[0 ])
8784
8885 return  min ( candidates  , key =  lambda  y  :(y [1 ][1 ]- y [1 ][0 ]) )[0 ]
8986
0 commit comments