1
0
forked from VimPlug/jedi

Remove a lot of the old Name.names usages in favor of a direct NamePart usage.

This commit is contained in:
Dave Halter
2014-09-22 22:34:33 +02:00
parent 04cf742973
commit dae1a48d70
11 changed files with 44 additions and 50 deletions

View File

@@ -354,6 +354,7 @@ class Parser(object):
elif in_lambda_param and tok.string == ':':
in_lambda_param = False
elif tok.type == tokenize.NAME and not is_kw:
tok_list[-1], tok = self._parse_name(tok)
continue
elif tok.string in opening_brackets:
level += 1
@@ -456,7 +457,7 @@ class Parser(object):
elif tok_str == 'import':
imports = self._parse_import_list()
for count, (names, alias, defunct) in enumerate(imports):
e = (alias or m or self._gen.previous).end_pos
e = (alias or names and names[-1] or self._gen.previous).end_pos
end_pos = self._gen.previous.end_pos if count + 1 == len(imports) else e
i = pr.Import(self.module, first_pos, end_pos, names,
alias, defunct=defunct)