Fix working with async functions in the diff parser, fixes #56

This commit is contained in:
Dave Halter
2019-02-06 09:23:08 +01:00
parent 0d37ff865c
commit 6c65aea47d
2 changed files with 19 additions and 0 deletions

View File

@@ -682,6 +682,8 @@ class _NodesTree(object):
last = new_nodes[-1]
if last.type == 'decorated':
last = last.children[-1]
if last.type in ('async_funcdef', 'async_stmt'):
last = last.children[-1]
last_line_offset_leaf = last.children[-2].get_last_leaf()
assert last_line_offset_leaf == ':'
else: