forked from VimPlug/jedi
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
|
||||
elif typ == INDENT:
|
||||
self._indent_counter += 1
|
||||
elif typ == ERRORTOKEN:
|
||||
self._add_syntax_error('Strange token', start_pos)
|
||||
continue
|
||||
|
||||
yield typ, value, prefix, start_pos
|
||||
|
||||
|
||||
@@ -650,7 +650,7 @@ class ErrorNode(BaseNode):
|
||||
type = 'error_node'
|
||||
|
||||
|
||||
class ErrorLeaf(Leaf):
|
||||
class ErrorLeaf(LeafWithNewLines):
|
||||
"""
|
||||
TODO doc
|
||||
"""
|
||||
|
||||
@@ -440,6 +440,7 @@ def test_string_literals():
|
||||
""")
|
||||
|
||||
script = jedi.Script(dedent(source))
|
||||
script._parser.module().end_pos == (6, 0)
|
||||
assert script.completions()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user