Fix diff parser: DEDENT as error leaves should also be ignored and reparsed

This commit is contained in:
Dave Halter
2019-01-18 18:41:08 +01:00
parent f3015efb2d
commit 0bd17bee2c
2 changed files with 28 additions and 2 deletions

View File

@@ -617,7 +617,7 @@ class _NodesTree(object):
# Endmarkers just distort all the checks below. Remove them.
break
if node.type == 'error_leaf' and node.token_type == 'ERROR_DEDENT':
if node.type == 'error_leaf' and node.token_type in ('DEDENT', 'ERROR_DEDENT'):
break
# TODO this check might take a bit of time for large files. We
# might want to change this to do more intelligent guessing or