U
    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   s>   |  dd|d }|dkr$|d }n|| dd| }||fS )N
       )countrindex)docposlinenocolno r   3/usr/lib/python3/dist-packages/simplejson/errors.pylinecol   s
    
r   Nc           	      C   sn   t ||\}}| dt|||d  } |d krFd}|| |||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
   Z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   sn   t | t||||d || _|| _|| _|| _t||\| _| _	|d k	r^t||\| _
| _n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__)N)__name__
__module____qualname____doc__r   r   r   r   r   r   r      s   
)N)r   __all__r   r   r   r   r   r   r   r   <module>   s   	
