o
    ȷe                     @   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   H/var/www/ideatree/venv/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
    
	