Account for code parts that were not parsed in the fast parser.

This commit is contained in:
Dave Halter
2015-02-19 01:42:13 +01:00
parent 39bf9f426b
commit 0e73bf7d80
2 changed files with 47 additions and 13 deletions

View File

@@ -368,6 +368,24 @@ def test_backslash():
check_fp(src, 2)
def test_fake_parentheses():
"""
The fast parser splitting counts parentheses, but not as correct tokens.
Therefore parentheses in string tokens are included as well. This needs to
be accounted for.
"""
src = dedent(r"""
def x():
a = (')'
if 1 else 2)
def y():
pass
def z():
pass
""")
check_fp(src, 3, 2)
def test_incomplete_function():
source = '''return ImportErr'''