o
    q!ågÏ  ã                   @   s.   d Z dgZG dd„ deƒZdd„ Zdd„ ZdS )zJSON decode error class
ÚErrorc                   @   s   e Zd ZdZdd„ ZdS )r   aØ  Subclass of ValueError with the following additional properties:

    msg: The unformatted error message
    doc: The JSON document being parsed
    pos: The start index of doc where parsing failed
    end: The end index of doc where parsing failed (may be None)
    lineno: The line corresponding to pos
    colno: The column corresponding to pos
    endlineno: The line corresponding to end (may be None)
    endcolno: The column corresponding to end (may be None)

    c                 C   s<   t  | t|||ƒ¡ || _|| _|| _t||ƒ\| _| _d S )N)	Ú
ValueErrorÚ__init__ÚerrmsgÚmsgÚdocÚposÚlinecolÚlinenoÚcolno)Úselfr   r   r   © r   úQ/mnt/skqttb/ctump_chatbot/chatbot/lib/python3.10/site-packages/dirtyjson/error.pyr      s
   zError.__init__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r      s    c                 C   sD   |   dd|¡d }|dkr|d }||fS ||  dd|¡ }||fS )NÚ
é    é   )ÚcountÚrindex)r   r   r	   r
   r   r   r   r      s   ÿr   c                 C   s>   t ||ƒ\}}|  dt|||d … ƒ¡} d}|| |||f S )Nz%rr   z%s: line %d column %d (char %d))r   ÚreplaceÚrepr)r   r   r   r	   r
   Úfmtr   r   r   r   &   s   r   N)r   Ú__all__r   r   r   r   r   r   r   r   Ú<module>   s
    	