@@ -163,11 +163,12 @@ def after_double_dot(t):
163163 )
164164
165165def before_double_dot (t ):
166- return t [ - 1 ] is None or not (
167- start_atom (t [1 ]) or
166+ return t [- 1 ] is None or not (
167+ finish_atom (t [- 1 ]) or
168168 t [- 1 ].string .isspace () or
169169 t [- 1 ].string == "["
170170 )
171+
171172def before_dot (t ):
172173 return t [ - 1 ] is None or not (
173174 t [- 1 ].string in ["from" ,"." ,"import" ] or
@@ -190,20 +191,16 @@ def handle_empty_compound(atok ,t,l,b,dummy):
190191 left ,right = expand_to_line_or_statement (atok ,t , l , b )
191192 if token .DEDENT == left .type :
192193 left = next_token (atok ,left )
193- print ("empty compound " ,[left ,right ])
194194 if t .string == "elif" and left .string != "elif" :
195195 left = next_token (atok ,left )
196196 if left is t and right .string == ":" :
197197 rh = next_token (atok ,right )
198- # print("rh is",[rh])
199198 while rh and (rh .line .isspace () or rh .start [0 ]== right .start [0 ]):
200- # print("rh is",[rh])
201199 rh = next_token (atok , rh )
202200 temporary = left .line
203201 ls = temporary [:len (temporary ) - len (temporary .lstrip ())]
204202 temporary = rh .line if rh else ""
205203 rs = temporary [:len (temporary ) - len (temporary .lstrip ())]
206- (print ("\n starting new variation\n " ,[t ],"\n " ,ls ,rs ,"these are the indentations" ,len (ls ),len (rs ),[left ,rh ]))
207204 if len (ls )>= len (rs ):
208205 return True , right .endpos ," pass " , False
209206 else :
@@ -237,7 +234,7 @@ def process_token(atok,t,l,b ):
237234 after = after_bracket (n )
238235 after_space = False
239236 elif s in [":" ]:
240- before = False
237+ before = before_double_dot ( n )
241238 before_space = False
242239 after = after_double_dot (n )
243240 after_space = False
0 commit comments