forked from VimPlug/jedi
fixes jedi-vim issue 9 - parser error in with statement
This commit is contained in:
@@ -1702,7 +1702,8 @@ class PyFuzzyParser(object):
|
|||||||
# multiple statements because of with
|
# multiple statements because of with
|
||||||
inits = []
|
inits = []
|
||||||
first = True
|
first = True
|
||||||
while first or command == 'with' and tok != ':':
|
while first or command == 'with' \
|
||||||
|
and tok not in [':', '\n']:
|
||||||
statement, tok = \
|
statement, tok = \
|
||||||
self._parse_statement(added_breaks=added_breaks)
|
self._parse_statement(added_breaks=added_breaks)
|
||||||
if command == 'except' and tok in added_breaks:
|
if command == 'except' and tok in added_breaks:
|
||||||
|
|||||||
@@ -161,6 +161,10 @@ class TestRegression(unittest.TestCase):
|
|||||||
s = "import time; abc = time; abc.sleep("
|
s = "import time; abc = time; abc.sleep("
|
||||||
assert check(self.get_in_function_call(s), 'sleep', 0)
|
assert check(self.get_in_function_call(s), 'sleep', 0)
|
||||||
|
|
||||||
|
# jedi-vim #9
|
||||||
|
s = "with open("
|
||||||
|
assert check(self.get_in_function_call(s), 'open', 0)
|
||||||
|
|
||||||
def test_add_dynamic_mods(self):
|
def test_add_dynamic_mods(self):
|
||||||
api.settings.additional_dynamic_modules = ['dynamic.py']
|
api.settings.additional_dynamic_modules = ['dynamic.py']
|
||||||
# Fictional module that defines a function.
|
# Fictional module that defines a function.
|
||||||
|
|||||||
Reference in New Issue
Block a user