a
    Yc                     @   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   P/var/www/html/MEGASTUDIO_platform/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   