mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-07 05:14:29 +08:00
Use a bit better warnings for tokenizer errors.
This commit is contained in:
@@ -106,6 +106,12 @@ FAILING_EXAMPLES = [
|
||||
r'b"\x"',
|
||||
r'b"\"',
|
||||
|
||||
# Parser/tokenize.c
|
||||
r'"""',
|
||||
r'"',
|
||||
r"'''",
|
||||
r"'",
|
||||
|
||||
# SyntaxErrors from Python/symtable.c
|
||||
'def f(x, x): pass',
|
||||
'nonlocal a',
|
||||
@@ -319,10 +325,6 @@ def _get_actual_exception(code):
|
||||
if sys.version_info[:2] == (2, 6) and wanted == 'SyntaxError: unexpected EOF while parsing':
|
||||
wanted = 'SyntaxError: invalid syntax'
|
||||
|
||||
if wanted == 'SyntaxError: EOL while scanning string literal':
|
||||
# TODO This is not what we want in the future. Remove this.
|
||||
wanted = 'SyntaxError: invalid syntax'
|
||||
|
||||
if wanted == 'SyntaxError: non-keyword arg after keyword arg':
|
||||
# The python 3.5+ way, a bit nicer.
|
||||
wanted = 'SyntaxError: positional argument follows keyword argument'
|
||||
|
||||
Reference in New Issue
Block a user