1
0
forked from VimPlug/jedi

fix problems with imports as user_statement and brackets, fixes #285

This commit is contained in:
David Halter
2013-08-11 01:14:13 +04:30
parent ec347dd975
commit 86394a7ed5
2 changed files with 3 additions and 4 deletions

View File

@@ -350,7 +350,7 @@ class Script(object):
""" """
Used for goto_assignments and usages. Used for goto_assignments and usages.
:param add_import_name: TODO add description :param add_import_name: Add the the name (if import) to the result.
""" """
def follow_inexistent_imports(defs): def follow_inexistent_imports(defs):
""" Imports can be generated, e.g. following """ Imports can be generated, e.g. following

View File

@@ -175,10 +175,10 @@ class Parser(object):
while True: while True:
defunct = False defunct = False
token_type, tok = self.next() token_type, tok = self.next()
if brackets and tok == '\n':
self.next()
if tok == '(': # python allows only one `(` in the statement. if tok == '(': # python allows only one `(` in the statement.
brackets = True brackets = True
token_type, tok = self.next()
if brackets and tok == '\n':
self.next() self.next()
i, token_type, tok = self._parse_dot_name(self._current) i, token_type, tok = self._parse_dot_name(self._current)
if not i: if not i:
@@ -191,7 +191,6 @@ class Parser(object):
token_type, tok = self.next() token_type, tok = self.next()
if not (tok == "," or brackets and tok == '\n'): if not (tok == "," or brackets and tok == '\n'):
break break
print imports
return imports return imports
def _parse_parentheses(self): def _parse_parentheses(self):