mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +08:00
Add error token in a normal way to the syntax tree as ErrorLeaf.
This commit is contained in:
@@ -499,9 +499,6 @@ class ParserWithRecovery(Parser):
|
|||||||
self._indent_counter -= 1
|
self._indent_counter -= 1
|
||||||
elif typ == INDENT:
|
elif typ == INDENT:
|
||||||
self._indent_counter += 1
|
self._indent_counter += 1
|
||||||
elif typ == ERRORTOKEN:
|
|
||||||
self._add_syntax_error('Strange token', start_pos)
|
|
||||||
continue
|
|
||||||
|
|
||||||
yield typ, value, prefix, start_pos
|
yield typ, value, prefix, start_pos
|
||||||
|
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ class ErrorNode(BaseNode):
|
|||||||
type = 'error_node'
|
type = 'error_node'
|
||||||
|
|
||||||
|
|
||||||
class ErrorLeaf(Leaf):
|
class ErrorLeaf(LeafWithNewLines):
|
||||||
"""
|
"""
|
||||||
TODO doc
|
TODO doc
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -440,6 +440,7 @@ def test_string_literals():
|
|||||||
""")
|
""")
|
||||||
|
|
||||||
script = jedi.Script(dedent(source))
|
script = jedi.Script(dedent(source))
|
||||||
|
script._parser.module().end_pos == (6, 0)
|
||||||
assert script.completions()
|
assert script.completions()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user