diff --git a/rplugin/python3/semshi/visitor.py b/rplugin/python3/semshi/visitor.py index 48239e2..ad681da 100644 --- a/rplugin/python3/semshi/visitor.py +++ b/rplugin/python3/semshi/visitor.py @@ -107,7 +107,7 @@ def visit(self, node): self._visit_args(node) self._mark_self(node) # Either make a new block scope... - if type_ in BLOCKS: + if type_ in BLOCKS and len(self._table_stack) > 0: current_table = self._table_stack.pop() self._table_stack += reversed(current_table.get_children()) self._env.append(current_table)