Start implementing the bulk of the context/value separation

This commit is contained in:
Dave Halter
2019-08-16 16:12:12 +02:00
parent d19233a338
commit 165639c1dd
23 changed files with 322 additions and 251 deletions
+2 -2
View File
@@ -159,7 +159,7 @@ class FunctionExecutionFilter(ParserTreeFilter):
if param:
yield self.param_name(self.value, name)
else:
yield TreeNameDefinition(self.value, name)
yield TreeNameDefinition(self.context, name)
class GlobalNameFilter(AbstractUsedNamesFilter):
@@ -362,7 +362,7 @@ def get_global_filters(inference_state, value, until_position, origin_scope):
>>> scope = next(module_node.iter_funcdefs())
>>> scope
<Function: func@3-5>
>>> value = script._get_module().create_value(scope)
>>> value = script._get_module_context().create_context(scope)
>>> filters = list(get_global_filters(value.inference_state, value, (4, 0), None))
First we get the names from the function scope.