Updates the elements in the module 'result' that have character indices
        that are a subset of another element. These correspond to cases where the
        type or subroutine is declared within another subroutine.

        :attr attribute: the name of the collection to update over.

def update_embedded(self, attribute):
        """Updates the elements in the module 'result' that have character indices
        that are a subset of another element. These correspond to cases where the
        type or subroutine is declared within another subroutine.

        :attr attribute: the name of the collection to update over.
        """
        #The parser doesn't handle embeddings deeper than two levels.
        coll = self.collection(attribute)
        keys = list(coll.keys())
        for key in keys:
            element = coll[key]
            new_parent = self.find_embedded_parent(element)
            if new_parent is not None:
                #Update the parent of the embedded element, add it to the collection
                #of the parent element and then delete it from the module's collection.
                element.parent = new_parent
                if attribute == "types":
                    new_parent.types[key] = element
                else:
                    new_parent.executables[key] = element
                del coll[key]