mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-08 05:34:51 +08:00
Fix error recovery for multi line strings at the end of the file
This commit is contained in:
@@ -1509,3 +1509,18 @@ def test_async_func2(differ):
|
||||
''')
|
||||
differ.initialize(code1)
|
||||
differ.parse(code2, parsers=2, copies=1, expect_error_leaves=True)
|
||||
|
||||
|
||||
def test_weird_ending(differ):
|
||||
code1 = dedent('''\
|
||||
def foo():
|
||||
a
|
||||
return
|
||||
''')
|
||||
code2 = dedent('''\
|
||||
def foo():
|
||||
a
|
||||
nonlocal xF"""
|
||||
y"""''')
|
||||
differ.initialize(code1)
|
||||
differ.parse(code2, parsers=1, copies=1, expect_error_leaves=True)
|
||||
|
||||
Reference in New Issue
Block a user