mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-06 21:04:29 +08:00
Add a check to see if leaves have the right start positions
This commit is contained in:
@@ -41,6 +41,11 @@ def _assert_valid_graph(node):
|
||||
try:
|
||||
children = node.children
|
||||
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)
|
||||
return
|
||||
|
||||
for child in children:
|
||||
|
||||
Reference in New Issue
Block a user