1
0
forked from VimPlug/jedi

Evaluator -> InferState

This commit is contained in:
Dave Halter
2019-08-15 00:33:49 +02:00
parent 8157d119a7
commit a5dff65142
62 changed files with 768 additions and 768 deletions

View File

@@ -56,12 +56,12 @@ class RecursionDetector(object):
@contextmanager
def execution_allowed(evaluator, node):
def execution_allowed(infer_state, node):
"""
A decorator to detect recursions in statements. In a recursion a statement
at the same place, in the same module may not be executed two times.
"""
pushed_nodes = evaluator.recursion_detector.pushed_nodes
pushed_nodes = infer_state.recursion_detector.pushed_nodes
if node in pushed_nodes:
debug.warning('catched stmt recursion: %s @%s', node,
@@ -78,7 +78,7 @@ def execution_allowed(evaluator, node):
def execution_recursion_decorator(default=NO_CONTEXTS):
def decorator(func):
def wrapper(self, **kwargs):
detector = self.evaluator.execution_recursion_detector
detector = self.infer_state.execution_recursion_detector
limit_reached = detector.push_execution(self)
try:
if limit_reached:
@@ -96,8 +96,8 @@ class ExecutionRecursionDetector(object):
"""
Catches recursions of executions.
"""
def __init__(self, evaluator):
self._evaluator = evaluator
def __init__(self, infer_state):
self._infer_state = infer_state
self._recursion_level = 0
self._parent_execution_funcs = []
@@ -117,7 +117,7 @@ class ExecutionRecursionDetector(object):
module = execution.get_root_context()
if module == self._evaluator.builtins_module:
if module == self._infer_state.builtins_module:
# We have control over builtins so we know they are not recursing
# like crazy. Therefore we just let them execute always, because
# they usually just help a lot with getting good results.