mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-08 05:34:51 +08:00
Some better message for tokenizing fails.
This commit is contained in:
@@ -512,6 +512,9 @@ class ErrorFinder(Normalizer):
|
|||||||
else:
|
else:
|
||||||
message = 'unindent does not match any outer indentation level'
|
message = 'unindent does not match any outer indentation level'
|
||||||
self._add_indentation_error(message, spacing)
|
self._add_indentation_error(message, spacing)
|
||||||
|
else:
|
||||||
|
if leaf.value.startswith('\\'):
|
||||||
|
message = 'unexpected character after line continuation character'
|
||||||
else:
|
else:
|
||||||
match = re.match('\\w{,2}("{1,3}|\'{1,3})', leaf.value)
|
match = re.match('\\w{,2}("{1,3}|\'{1,3})', leaf.value)
|
||||||
if match is None:
|
if match is None:
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ FAILING_EXAMPLES = [
|
|||||||
r'"',
|
r'"',
|
||||||
r"'''",
|
r"'''",
|
||||||
r"'",
|
r"'",
|
||||||
|
r"\blub",
|
||||||
|
|
||||||
# SyntaxErrors from Python/symtable.c
|
# SyntaxErrors from Python/symtable.c
|
||||||
'def f(x, x): pass',
|
'def f(x, x): pass',
|
||||||
|
|||||||
Reference in New Issue
Block a user