def type_search(self, basetype, symbolstr, origin):
        """Recursively traverses the module trees looking for the final
        code element in a sequence of %-separated symbols.

        :arg basetype: the type name of the first element in the symbol string.
        :arg symblstr: a %-separated list of symbols, e.g. this%sym%sym2%go.
        :arg origin: an instance of the Module class that started the request.
        """
        symbols = symbolstr.split("%")
        base, basemod = self.tree_find(basetype, origin, "types")
        
        #As long as we keep finding child objects, we can continue
        #until we run out of symbols in the list
        i = 1
        while isinstance(base, CustomType) and i < len(symbols): 
            #We will look inside the types members and executables
            if symbols[i] in base.members:
                #Types can have types inside of them. If the next symbol
                #is a member, we need to check if it is also a custom type
                base = base.members[symbols[i]]
                if base.is_custom:
                    base, basemod = self.tree_find(base.kind, origin, "types")
            elif symbols[i] in base.executables:
                base = base.executables[symbols[i]]
            #We want to keep iterating through until we find a non-type
            #which is either a non-type member or an executable
            i += 1

        return base
def type_search ( self , basetype , symbolstr , origin ) : symbols = symbolstr . split ( "%" ) base , basemod = self . tree_find ( basetype , origin , "types" ) i = 1 while isinstance ( base , CustomType ) and i < len ( symbols ) : if symbols [ i ] in base . members : base = base . members [ symbols [ i ] ] if base . is_custom : base , basemod = self . tree_find ( base . kind , origin , "types" ) elif symbols [ i ] in base . executables : base = base . executables [ symbols [ i ] ] i += 1 return base
Recursively traverses the module trees looking for the final
        code element in a sequence of %-separated symbols.

        :arg basetype: the type name of the first element in the symbol string.
        :arg symblstr: a %-separated list of symbols, e.g. this%sym%sym2%go.
        :arg origin: an instance of the Module class that started the request.