1
0
forked from VimPlug/jedi

Further improvements to the interpreter refactoring.

This commit is contained in:
Dave Halter
2016-05-19 01:41:06 +02:00
parent 1bb8d32084
commit a08ad2d53d
3 changed files with 18 additions and 6 deletions

View File

@@ -18,13 +18,17 @@ from jedi.evaluate import iterable
from jedi.evaluate.compiled import mixed
def add_namespaces_to_parser(evaluator, namespaces, parser_module):
for namespace in namespaces:
for key, value in namespace.items():
def add_namespaces_to_parser(evaluator, namespace_dicts, parser_module):
for dct in namespace_dicts:
namespace = compiled.CompiledObject(evaluator, type('namespace', (), dct))
for key, value in dct.items():
# Name lookups in an ast tree work by checking names_dict.
# Therefore we just add fake names to that and we're done.
arr = parser_module.names_dict.setdefault(key, [])
arr.append(LazyName(evaluator, parser_module, key, value))
name = mixed.MixedName(evaluator, namespace, key)
arr.append(name)
#arr.append(LazyName(evaluator, parser_module, key, value))
class LazyName(helpers.FakeName):