a
    Oc,                     @   s   d Z dd ZG dd dZdS )z
Base token class.
c                 C   s>   t | tr6t| }d}||kr6d| d| || S t| S )zV
    Return a shortened ``repr`` output of value for use in ``__repr__`` methods.
       z{0!r}...+{1}N)
isinstancestrlenformatrepr)valuechars	threshold r
   G/var/www/html/megastudio/lib/python3.9/site-packages/mistletoe/token.py_short_repr   s    
r   c                   @   s   e Zd ZdZdZdd ZdS )Tokena  
    Base token class.

    `Token` has two subclasses:

    * `block_token.BlockToken`, for all block level tokens. A block level token
      is text which occupies the entire horizontal width of the "page" and is
      offset for the surrounding sibling block with line breaks.

    * `span_token.SpanToken`, for all span-level (or inline-level) tokens.
      A span-level token appears inside the flow of the text lines without any
      surrounding line break.

    Custom ``__repr__`` methods in subclasses: The default ``__repr__``
    implementation outputs the number of child tokens (from the attribute
    ``children``) if applicable, and the ``content`` attribute if applicable.
    If any additional attributes should be included in the ``__repr__`` output,
    this can be specified by setting the class attribute ``repr_attributes``
    to a tuple containing the attribute names to be output.
    r
   c                 C   s   d | jj| jj}t| drHt| j}|dkr:|d7 }n|d |7 }t| drd|dt| j 7 }| j	D ]"}t
| |}|d |t|7 }qj|d	 t| 7 }|S )
Nz<{}.{}children   z with 1 childz with {} childrencontentz	 content=z {}={}z
 at {:#x}>)r   	__class__
__module____name__hasattrr   r   r   r   repr_attributesgetattrid)selfoutputcountattrname	attrvaluer
   r
   r   __repr__+   s     





zToken.__repr__N)r   r   __qualname____doc__r   r   r
   r
   r
   r   r      s   r   N)r   r   r   r
   r
   r
   r   <module>   s   