@@ -119,7 +119,7 @@ def _get_tokens(self, statements):
119119 else :
120120 ignored_types = {None }
121121 name_types = {Token .TESTCASE_NAME , Token .KEYWORD_NAME }
122- if_type = Token .IF
122+ if_type = Token .INLINE_IF
123123 for statement in statements :
124124 eos_adder = None
125125 result = []
@@ -162,12 +162,9 @@ def _add_eos_to_name_statement(self, statement):
162162 statement .append (EOS .from_token (statement [- 1 ]))
163163
164164 def _add_eos_to_if_statement (self , statement ):
165- if_else_markers = {Token .IF : (False , True ),
165+ if_else_markers = {Token .INLINE_IF : (False , True ),
166166 Token .ELSE_IF : (True , True ),
167167 Token .ELSE : (True , False )}
168- normal_if_statement_types = {Token .IF , Token .ARGUMENT , # TODO: Continuation?
169- Token .SEPARATOR , Token .EOL }
170- inline_if = False
171168 added = 0
172169 add_after_arg = False
173170 for index , token in enumerate (statement [:]):
@@ -184,15 +181,10 @@ def _add_eos_to_if_statement(self, statement):
184181 statement .insert (index + added + 1 , EOS .from_token (token ))
185182 added += 1
186183 add_after_arg = False
187- if token_type not in normal_if_statement_types :
188- inline_if = True
189184 last = statement [- 1 ]
190- if not added :
191- statement .append (EOS .from_token (last ))
192- if inline_if :
193- statement .extend ([EOS .from_token (last ),
194- END .from_token (last , virtual = True ),
195- EOS .from_token (last )])
185+ statement .extend ([EOS .from_token (last ),
186+ END .from_token (last , virtual = True ),
187+ EOS .from_token (last )])
196188
197189 def _split_trailing_commented_and_empty_lines (self , statement ):
198190 lines = self ._split_to_lines (statement )
0 commit comments