
 X-                 @   s   d  Z  d d l Z d d   Z e   Z d d g Z e j d e j e j Be j B Z	 Gd d   d e
  Z d	 d
   Z d d d  Z d d   Z e p e Z d S)zJSON token scanner
    Nc              C   s5   y d d l  m }  |  SWn t k
 r0 d  SYn Xd  S)Nr   )make_scanner)Zsimplejson._speedupsr   ImportError)r    r   O/home/ubuntu/projects/ifolica/lib/python3.4/site-packages/simplejson/scanner.py_import_c_make_scanner   s
    r   r   JSONDecodeErrorz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?c               @   s1   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   s   t  j |  t | | | d |  | |  _ | |  _ | |  _ | |  _ t | |  \ |  _ |  _	 | d  k	 r t | |  \ |  _
 |  _ n d \ |  _
 |  _ d  S)Nend)NN)
ValueError__init__errmsgmsgdocposr   linecollinenocolno	endlinenoendcolno)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__,   s    zJSONDecodeError.__reduce__)__name__
__module____qualname____doc__r
   r   r   r   r   r   r      s   c             C   sU   |  j  d d |  d } | d k r2 | d } n | |  j d d |  } | | f S)N
r      )countrindex)r   r   r   r   r   r   r   r   0   s
    r   c       	      C   s   t  | |  \ } } |  j d t | | | d    }  | d  k ra d } | |  | | | f St  | |  \ } } 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)	r   r   r   r   r   r   fmtr   r   r   r   r   r   9   s    &r   c                s   |  j  
 |  j  |  j  t j  |  j  |  j  |  j  |  j 	 |  j	  |  j
  |  j  |  j            	 
   f d d        f d d   } | S)Nc       	         s  d } y |  | } Wn$ t  k
 r: t | |  |   Yn X| d k r^  |  | d    S| d k r 
 |  | d f         S| d k r  |  | d f    S| d k r |  | | d  d k r d  | d f S| d	 k r|  | | d  d
 k rd | d f S| d k rO|  | | d  d k rOd | d f S |  |  } | d  k	 r| j   \ } } } | s| r | | pd | pd  } n 	 |  } | | j   f S| d k r|  | | d  d k r d  | d f S| d k r>|  | | d  d k r> d  | d f S| d k rx|  | | d  d k rx d  | d f St | |  |   d  S)NzExpecting value"r   {[n   ZnullttrueTf   falseF N   ZNaNI   ZInfinity-	   z	-Infinity)
IndexErrorr   groupsr   )	stringidxr   ZnextcharmZintegerfracexpres)
_scan_onceencodingmatch_numbermemoobject_hookobject_pairs_hookparse_arrayparse_constantparse_float	parse_intparse_objectparse_stringstrictr   r   r;   R   s@    &&&#&&&z#py_make_scanner.<locals>._scan_oncec          
      sD   | d k  r! t  d |  |   n  z   |  |  SWd   j   Xd  S)Nr   zExpecting value)r   clear)r5   r6   )r;   r>   r   r   	scan_oncex   s
    z"py_make_scanner.<locals>.scan_once)rE   rA   rF   	NUMBER_REmatchr<   rG   rC   rD   rB   r?   r@   r>   )contextrI   r   )r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r   py_make_scannerD   s    												6&rM   )r   rer   Zc_make_scanner__all__compileVERBOSE	MULTILINEDOTALLrJ   r	   r   r   r   rM   r   r   r   r   r   <module>   s   		A