o
    noi                      @  s~   U d dl mZ d dlZd dlmZmZ d dlmZmZ d dl	m
Z
 dZded< ed	d	d	d
dddZed	d	d	d
dddZdS )    )annotationsN)ListSequence)CSTLogicErrorCSTNode)filter_node_fieldsz  str_DEFAULT_INDENTFindentshow_defaultsshow_syntaxshow_whitespacenodeobjectr   r   boolr   r   return	List[str]c                  s  t | trt| |||d}| jjg}t|dkr|d |S |d |D ]}|jdg}t| |j}	t |	t	t
fs?t |	tsL|t|	 |||d nct |	trt|	dkr|d g }
t|	d }t|	D ]\}}|
t| |||d ||kr|
d	 qh|
d
 qhd|
d}|d fdd|D  |d n
|d ntdd|d}|d fdd|D  |d	 q&|d |S t| gS )N)r   r   r   r   r   z()z(
=)r   r   r   r   z[
   z,
, 
c                 3      | ]	}  | V  qd S N .0tr   r   G/home/ubuntu/.local/lib/python3.10/site-packages/libcst/display/text.py	<genexpr>P       z'_node_repr_recursive.<locals>.<genexpr>z
]z[]zLogic error!c                 3  r   r   r   r   r   r   r    r!   [   r"   ))
isinstancer   r   	__class____name__lenappendnamegetattrr   bytesr   extend_node_repr_recursive	enumeratejoinsplitr   repr)r   r   r   r   r   fieldstokensfieldchild_tokensvaluelist_tokens
last_valuejvsplit_by_liner   r   r    r-      sp   


;


	
	

r-   r   c             	   C  s   d t| ||||dS )a\  
    Returns a string representation of the node that contains minimal differences
    from the default contruction of the node while also hiding whitespace and
    syntax fields.

    Setting ``show_defaults`` to ``True`` will add fields regardless if their
    value is different from the default value.

    Setting ``show_whitespace`` will add whitespace fields and setting
    ``show_syntax`` will add syntax fields while respecting the value of
    ``show_defaults``.

    When all keyword args are set to true, the output of this function is
    indentical to the __repr__ method of the node.
    r   r
   )r/   r-   )r   r   r   r   r   r   r   r    dumpf   s   r<   )r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   )
__future__r   dataclassestypingr   r   libcstr   r   libcst.helpersr   r	   __annotations__r-   r<   r   r   r   r    <module>   s    X