o
    ¡ØÆh~  ã                   @   s8   d Z ddlZG dd„ deƒZdd„ ZG dd„ deƒZdS )	z?General tools which don't depend on other parts of Parsimoniousé    Nc                   @   s   e Zd ZdZdd„ ZdS )Ú
StrAndReprz;Mix-in which gives the class the same __repr__ and __str__.c                 C   s   |   ¡ S ©N)Ú__str__©Úself© r   ú_/var/www/html/HyperOracle/crypto_trader/venv/lib/python3.10/site-packages/parsimonious/utils.pyÚ__repr__	   s   zStrAndRepr.__repr__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   r   r   r   r      s    r   c                 C   s
   t  | ¡S )zûPiggyback on Python's string support so we can have backslash escaping
    and niceties like 
, 	, etc.

    This also supports:
    1. b"strings", allowing grammars to parse bytestrings, in addition to str.
    2. r"strings" to simplify regexes.
    )ÚastÚliteral_eval)Ústringr   r   r   Úevaluate_string   s   
r   c                   @   s.   e Zd ZdZdgZdd„ Zdd„ Zdd„ Zd	S )
ÚTokenaG  A class to represent tokens, for use with TokenGrammars

    You will likely want to subclass this to hold additional information, like
    the characters that you lexed to create this token. Alternately, feel free
    to create your own class from scratch. The only contract is that tokens
    must have a ``type`` attr.

    Útypec                 C   s
   || _ d S r   ©r   )r   r   r   r   r   Ú__init__#   s   
zToken.__init__c                 C   s   d| j f S )Nz<Token "%s">r   r   r   r   r   r   &   ó   zToken.__str__c                 C   s   | j |j kS r   r   )r   Úotherr   r   r   Ú__eq__)   r   zToken.__eq__N)r
   r   r   r   Ú	__slots__r   r   r   r   r   r   r   r      s    r   )r   r   Úobjectr   r   r   r   r   r   r   Ú<module>   s
    