mirror of
https://github.com/davidhalter/parso.git
synced 2026-11-01 09:16:21 +08:00
Fix diff parser: Skip last leaves for last line offset leaves
This commit is contained in:
1 parent
dac4c445a7
commit
e591b929eb
2 files changed
+15
No files matched your search
@@ -466,6 +466,10 @@ class _NodesTreeNode(object):
|
||||
if self._children_groups:
|
||||
children_group = self._children_groups[-1]
|
||||
last_leaf = children_group.last_line_offset_leaf
|
||||
while last_leaf.type == 'error_leaf' \
|
||||
and last_leaf.token_type in _INDENTATION_TOKENS:
|
||||
last_leaf = last_leaf.get_previous_leaf()
|
||||
|
||||
line = last_leaf.end_pos[0] + children_group.line_offset
|
||||
|
||||
# Newlines end on the next line, which means that they would cover
|
||||
|
||||
Reference in new issue
Block a user