Exemple #1
0
def getNodeScope(node):
    """Return the nearest lexically enclosing node with scope."""
    if nodeHasScope(node):
        return node.scope
    else:
        p = dka.getParentNode(node)
        return getNodeScope(p) if p is not None else None
Exemple #2
0
 def visit_ApplCase(self, node):
     if not (dka.getParentNode(node) is self.marker and
             dka.getParentIndex(node) == 0):
         assert()
     self.generic_visit(node)
Exemple #3
0
 def parentscope(self):
     """Return the next outer scope, or None if there isn't any."""
     p = dka.getParentNode(self.node)
     return getNodeScope(p) if p is not None else None