def push_globaldo(self, node_):
        # Just a clone, unlike the others using AbstractContext.push -- will
        # visit the target AST but finding the AST itself does not need to push
        # the Context (the do statement itself is not structural, i.e. affecting
        # node_ and context parents)
        clone = self.clone()
        scope = globaldo_get_scope(node_)
        proto = globaldo_get_target_full_name(self, node_)
        if scope != globaldo_EMPTY_SCOPE_NAME:
            clone._push_scope(scope)  # Current scope
            clone._push_scope_level(
            )  # Scopes encountered at this "scope level"

        # Also need to treat recLabs? for unscoped do? to avoid false shadowing

        do_frame = clone.peek_do_chain()
        # Tracking the "do-chain" (although as a key set -- order doesn't
        # matter) to detect recursive chains
        #gpd = clone.get_member(proto)
        #roles = globalprotocoldecl_get_roles(gpd)
        #params = globalprotocoldecl_get_parameters(gpd)
        roles = globaldo_get_role_args(node_)
        params = globaldo_get_argument_args(node_)
        #if proto not in do_frame.keys():
        if not clone.do_instance_in_chain(proto, roles, params):
            # True means a (recursive) do to this proto is permitted (set False
            # by push_globalparallel and push_globalinterruptible)
            clone._add_do_instance(proto, roles, params)
        else:
            # Checked in globaldo: shouldn't be visiting a recursive do-target
            raise Exception("Shouldn't get in here: ", proto)
        return clone
Exemple #2
0
 def push_globaldo(self, node_):
     # Just a clone, unlike the others using AbstractContext.push -- will
     # visit the target AST but finding the AST itself does not need to push
     # the Context (the do statement itself is not structural, i.e. affecting
     # node_ and context parents)
     clone = self.clone()
     scope = globaldo_get_scope(node_)
     proto = globaldo_get_target_full_name(self, node_)
     if scope != globaldo_EMPTY_SCOPE_NAME:
         clone._push_scope(scope)  # Current scope
         clone._push_scope_level()  # Scopes encountered at this "scope level"
         
     # Also need to treat recLabs? for unscoped do? to avoid false shadowing
         
     do_frame = clone.peek_do_chain()
     # Tracking the "do-chain" (although as a key set -- order doesn't
     # matter) to detect recursive chains
     #gpd = clone.get_member(proto)
     #roles = globalprotocoldecl_get_roles(gpd)
     #params = globalprotocoldecl_get_parameters(gpd)
     roles = globaldo_get_role_args(node_)
     params = globaldo_get_argument_args(node_)
     #if proto not in do_frame.keys():
     if not clone.do_instance_in_chain(proto, roles, params):
         # True means a (recursive) do to this proto is permitted (set False
         # by push_globalparallel and push_globalinterruptible)
         clone._add_do_instance(proto, roles, params)
     else:
         # Checked in globaldo: shouldn't be visiting a recursive do-target
         raise Exception("Shouldn't get in here: ", proto)
     return clone
 def pop_globaldo(self, node_):
     clone = self.clone()
     scope = globaldo_get_scope(node_)
     proto = globaldo_get_target_full_name(self, node_)
     if scope != globaldo_EMPTY_SCOPE_NAME:
         clone._pop_scope(scope)
         clone._pop_scope_level()
     #do_frame = clone.peek_do_chain()
     #del(do_frame[proto])
     gpd = self.get_member(proto)
     #roles = globalprotocoldecl_get_roles(gpd)
     #params = globalprotocoldecl_get_parameters(gpd)
     roles = globaldo_get_role_args(node_)
     params = globaldo_get_argument_args(node_)
     clone._remove_do_instance(proto, roles, params)
     return clone
Exemple #4
0
 def pop_globaldo(self, node_):
     clone = self.clone()
     scope = globaldo_get_scope(node_)
     proto = globaldo_get_target_full_name(self, node_)
     if scope != globaldo_EMPTY_SCOPE_NAME:
         clone._pop_scope(scope)
         clone._pop_scope_level()
     #do_frame = clone.peek_do_chain()
     #del(do_frame[proto])
     gpd = self.get_member(proto)
     #roles = globalprotocoldecl_get_roles(gpd)
     #params = globalprotocoldecl_get_parameters(gpd)
     roles = globaldo_get_role_args(node_)
     params = globaldo_get_argument_args(node_)
     clone._remove_do_instance(proto, roles, params)
     return clone