mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-08 05:34:51 +08:00
Fix for diff parser : Make sure that start_pos are growing always
The problem was that functions/classes were sometimes not well positioned. Now all diff tests are ensuring that leaves always grow.
This commit is contained in:
@@ -43,9 +43,8 @@ def _assert_valid_graph(node):
|
||||
except AttributeError:
|
||||
previous_leaf = node.get_previous_leaf()
|
||||
if previous_leaf is not None:
|
||||
if previous_leaf.type != 'error_leaf' or previous_leaf.token_type != 'INDENT':
|
||||
assert previous_leaf.end_pos == node.get_start_pos_of_prefix(), \
|
||||
(previous_leaf, node)
|
||||
assert previous_leaf.end_pos <= node.start_pos, \
|
||||
(previous_leaf, node)
|
||||
return
|
||||
|
||||
for child in children:
|
||||
|
||||
Reference in New Issue
Block a user