Fix get_start_pos_of_prefix

This commit is contained in:
Dave Halter
2019-01-24 00:00:06 +01:00
parent 01ae01a382
commit 32a83b932a
3 changed files with 50 additions and 19 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ class PythonLeaf(PythonMixin, Leaf):
# indent error leafs somehow? No idea how, though.
previous_leaf = self.get_previous_leaf()
if previous_leaf is not None and previous_leaf.type == 'error_leaf' \
and previous_leaf.token_type in ('INDENT', 'ERROR_DEDENT'):
and previous_leaf.token_type in ('INDENT', 'DEDENT', 'ERROR_DEDENT'):
previous_leaf = previous_leaf.get_previous_leaf()
if previous_leaf is None: # It's the first leaf.