mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-07 13:24:39 +08:00
General cleanup in syntax error detection. Adding a few comments.
This commit is contained in:
@@ -124,6 +124,8 @@ FAILING_EXAMPLES = [
|
|||||||
'*a = 3',
|
'*a = 3',
|
||||||
'del *a, b',
|
'del *a, b',
|
||||||
'def x(*): pass',
|
'def x(*): pass',
|
||||||
|
'(%s *d) = x' % ('a,' * 256),
|
||||||
|
'{**{} for a in [1]}',
|
||||||
|
|
||||||
# Parser/tokenize.c
|
# Parser/tokenize.c
|
||||||
r'"""',
|
r'"""',
|
||||||
@@ -247,12 +249,14 @@ GLOBAL_NONLOCAL_ERROR = [
|
|||||||
if sys.version_info >= (3, 6):
|
if sys.version_info >= (3, 6):
|
||||||
FAILING_EXAMPLES += GLOBAL_NONLOCAL_ERROR
|
FAILING_EXAMPLES += GLOBAL_NONLOCAL_ERROR
|
||||||
FAILING_EXAMPLES += [
|
FAILING_EXAMPLES += [
|
||||||
'(%s *d) = x' % ('a,' * 256),
|
# Raises multiple errors in previous versions.
|
||||||
'async def foo():\n def nofoo():[x async for x in []]',
|
'async def foo():\n def nofoo():[x async for x in []]',
|
||||||
]
|
]
|
||||||
if sys.version_info >= (3, 5):
|
if sys.version_info >= (3, 5):
|
||||||
FAILING_EXAMPLES += [
|
FAILING_EXAMPLES += [
|
||||||
|
# Raises different errors so just ignore them for now.
|
||||||
'[*[] for a in [1]]',
|
'[*[] for a in [1]]',
|
||||||
|
# Raises multiple errors in previous versions.
|
||||||
'async def bla():\n def x(): await bla()',
|
'async def bla():\n def x(): await bla()',
|
||||||
]
|
]
|
||||||
if sys.version_info >= (3, 4):
|
if sys.version_info >= (3, 4):
|
||||||
@@ -266,8 +270,9 @@ if sys.version_info >= (3,):
|
|||||||
'([False], a) = x',
|
'([False], a) = x',
|
||||||
# A symtable error that raises only a SyntaxWarning in Python 2.
|
# A symtable error that raises only a SyntaxWarning in Python 2.
|
||||||
'def x(): from math import *',
|
'def x(): from math import *',
|
||||||
|
# unicode chars in bytes are allowed in python 2
|
||||||
'b"ä"',
|
'b"ä"',
|
||||||
'{**{} for a in [1]}',
|
# combining strings and unicode is allowed in Python 2.
|
||||||
'"s" b""',
|
'"s" b""',
|
||||||
]
|
]
|
||||||
if sys.version_info >= (2, 7):
|
if sys.version_info >= (2, 7):
|
||||||
|
|||||||
Reference in New Issue
Block a user