o
    �O5[ó  ã                   @   s0   d Z dgZdd„ Zddd„ZG dd„ deƒZdS )	z!Error classes used by simplejson
ÚJSONDecodeErrorc                 C   sD   |   dd|¡d }|dkr|d }||fS ||  dd|¡ }||fS )NÚ
é    é   )ÚcountÚrindex)ÚdocÚposÚlinenoÚcolno© r   úC/var/www/html/env/lib/python3.10/site-packages/simplejson/errors.pyÚlinecol   s   ÿr   Nc           	      C   sn   t ||ƒ\}}|  dt|||d … ƒ¡} |d u r#d}|| |||f S t ||ƒ\}}d}|| ||||||f S )Nz%rr   z%s: line %d column %d (char %d)z8%s: line %d column %d - line %d column %d (char %d - %d))r   ÚreplaceÚrepr)	Úmsgr   r   Úendr	   r
   ÚfmtÚ	endlinenoÚendcolnor   r   r   Úerrmsg   s   r   c                   @   s"   e Zd ZdZdd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)

    Nc              	   C   sp   t  | t||||d�¡ || _|| _|| _|| _t||ƒ\| _| _	|d ur0t||ƒ\| _
| _d S d\| _
| _d S )N)r   )NN)Ú
ValueErrorÚ__init__r   r   r   r   r   r   r	   r
   r   r   )Úselfr   r   r   r   r   r   r   r   (   s   zJSONDecodeError.__init__c                 C   s   | j | j| j| j| jffS ©N)Ú	__class__r   r   r   r   )r   r   r   r   Ú
__reduce__4   s   zJSONDecodeError.__reduce__r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s    
r   )r   Ú__all__r   r   r   r   r   r   r   r   Ú<module>   s
    
	