a
    £ðOc¿  ã                   @   s(   d dl mZ edg d¢ƒZddd„ZdS )	é    )Ú
namedtupleÚTraverseResult)ÚnodeÚparentÚdepthNFc                 #   s¨   d}|rt ˆd|ƒV  ‡fdd„tˆdg ƒD ƒ}|r¤|du sD||kr¤|d7 }g }|D ]H\}‰ |du sntˆ |ƒr|t ˆ ||ƒV  | ‡ fdd„tˆ dg ƒD ƒ¡ qT|}q0dS )ap  Traverse the syntax tree, recursively yielding children.

    Args:

        source: The source syntax token
        klass: filter children by a certain token class
        depth (int): The depth to recurse into the tree
        include_source (bool): whether to first yield the source element

    Yields:
        A container for an element, its parent and depth
    r   Nc                    s   g | ]}ˆ |f‘qS © r   ©Ú.0Úc)Úsourcer   úG/var/www/html/megastudio/lib/python3.9/site-packages/mistletoe/utils.pyÚ
<listcomp>   ó    ztraverse.<locals>.<listcomp>Úchildrené   c                    s   g | ]}ˆ |f‘qS r   r   r   )Úchildr   r   r      r   )r   ÚgetattrÚ
issubclassÚextend)r   Úklassr   Zinclude_sourceZcurrent_depthZnext_childrenZnew_childrenr   r   )r   r   r   Útraverse   s    ÿr   )NNF)Úcollectionsr   r   r   r   r   r   r   Ú<module>   s   