Hacked By AnonymousFox

Current Path : /opt/alt/python35/lib64/python3.5/json/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/json/__pycache__/decoder.cpython-35.opt-1.pyc



��Yf&1�@s�dZddlZddlmZyddlmZWnek
rPdZYnXddgZej	ej
BejBZe
d�Ze
d�Ze
d	�ZGd
d�de�Zdeded
eiZejde�ZddddddddddddddddiZdd�Zdeejdd �Zep;eZejd!e�Zd"Zdejed#d$�Zejed%d&�ZGd'd�de�ZdS)(zImplementation of JSONDecoder
�N)�scanner)�
scanstring�JSONDecoder�JSONDecodeError�nan�infz-infc@s.eZdZdZdd�Zdd�ZdS)ra 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
    lineno: The line corresponding to pos
    colno: The column corresponding to pos

    cCs�|jdd|�d}||jdd|�}d||||f}tj||�||_||_||_||_||_dS)N�
r�z%s: line %d column %d (char %d))	�count�rfind�
ValueError�__init__�msg�doc�pos�lineno�colno)�selfrrrrr�errmsg�r�1/opt/alt/python35/lib64/python3.5/json/decoder.pyr
s				zJSONDecodeError.__init__cCs|j|j|j|jffS)N)�	__class__rrr)rrrr�
__reduce__*szJSONDecodeError.__reduce__N)�__name__�
__module__�__qualname__�__doc__r
rrrrrrs	z	-InfinityZInfinity�NaNz(.*?)(["\\\x00-\x1f])�"�\�/�b��f��nr�r�
�t�	cCs|||d|d�}t|�dkr`|ddkr`yt|d�SWntk
r_YnXd}t|||��dS)Nr	��ZxX�zInvalid \uXXXX escape)�len�intrr)�sr�escrrrr�
_decode_uXXXX;s"
r1TcCs+g}|j}|d}x�|||�}|dkrItd||��|j�}|j�\}	}
|	rw||	�|
dkr�PnC|
dkr�|r�dj|
�}t|||��n
||
�qy||}Wn$tk
r�td||��YnX|dkr\y||}
Wn3tk
rNdj|�}t|||��YnX|d7}n�t||�}|d	7}d
|ko�dknr�|||d�d
kr�t||d�}d|ko�dknr�d|d
d>|dB}|d7}t|�}
||
�qWdj	|�|fS)a�Scan the string s for a JSON string. End is the index of the
    character in s after the quote that started the JSON string.
    Unescapes all valid JSON string escape sequences and raises ValueError
    on attempt to decode an invalid string. If strict is False then literal
    control characters are allowed in the string.

    Returns a tuple of the decoded string and the index of the character in s
    after the end quote.r	NzUnterminated string starting atrrz"Invalid control character {0!r} at�uzInvalid \escape: {0!r}r*i�i���z\ui�i��i�
��)
�appendr�end�groups�format�
IndexError�KeyErrorr1�chr�join)r/r8�strictZ_b�_mZchunks�_appendZbegin�chunkZcontent�
terminatorrr0�charZuniZuni2rrr�
py_scanstringEsP
	






6
rEz
[ \t\n\r]*z 	

c#Cs�|\}}	g}
|
j}|dkr-i}|j}||	|	d�}
|
dkr|
|kr�|||	�j�}	||	|	d�}
|
dkr�|dk	r�||
�}||	dfSi}
|dk	r�||
�}
|
|	dfS|
dkrtd||	��|	d7}	x>t||	|�\}}	|||�}||	|	d�dkr�|||	�j�}	||	|	d�dkr�td||	��|	d7}	yG||	|kr�|	d7}	||	|kr�|||	d�j�}	Wntk
r�YnXy|||	�\}}	Wn=tk
rT}ztd||j�d�WYdd}~XnX|||f�y=||	}
|
|kr�|||	d�j�}	||	}
Wntk
r�d}
YnX|	d7}	|
dkr�Pn"|
d	kr�td
||	d��|||	�j�}	||	|	d�}
|	d7}	|
dkrtd||	d��qW|dk	rt||
�}||	fSt|
�}
|dk	r�||
�}
|
|	fS)Nr	r�}z1Expecting property name enclosed in double quotes�:zExpecting ':' delimiterzExpecting valuer6�,zExpecting ',' delimiter)	r7�
setdefaultr8rrr;�
StopIteration�value�dict)�	s_and_endr?�	scan_once�object_hook�object_pairs_hook�memo�_w�_wsr/r8ZpairsZpairs_appendZmemo_get�nextchar�result�keyrK�errrrr�
JSONObject�s�		



+




rXcCs�|\}}g}|||d�}||kr_|||d�j�}|||d�}|dkry||dfS|j}xLy|||�\}	}Wn=tk
r�}
ztd||
j�d�WYdd}
~
XnX||	�|||d�}||kr5|||d�j�}|||d�}|d7}|dkrOPn"|dkrqtd||d��yG|||kr�|d7}|||kr�|||d�j�}Wq�tk
r�Yq�Xq�W||fS)Nr	�]zExpecting valuerHzExpecting ',' delimiter)r8r7rJrrKr;)rMrNrRrSr/r8�valuesrTrArKrWrrr�	JSONArray�s@	+



	r[c@sUeZdZdZdddddddd�Zejdd�Zdd	d
�ZdS)raSimple JSON <http://json.org> decoder

    Performs the following translations in decoding by default:

    +---------------+-------------------+
    | JSON          | Python            |
    +===============+===================+
    | object        | dict              |
    +---------------+-------------------+
    | array         | list              |
    +---------------+-------------------+
    | string        | str               |
    +---------------+-------------------+
    | number (int)  | int               |
    +---------------+-------------------+
    | number (real) | float             |
    +---------------+-------------------+
    | true          | True              |
    +---------------+-------------------+
    | false         | False             |
    +---------------+-------------------+
    | null          | None              |
    +---------------+-------------------+

    It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as
    their corresponding ``float`` values, which is outside the JSON spec.

    NTcCs�||_|pt|_|p!t|_|p3tj|_||_||_	t
|_t|_
t|_i|_tj|�|_dS)aD``object_hook``, if specified, will be called with the result
        of every JSON object decoded and its return value will be used in
        place of the given ``dict``.  This can be used to provide custom
        deserializations (e.g. to support JSON-RPC class hinting).

        ``object_pairs_hook``, if specified will be called with the result of
        every JSON object decoded with an ordered list of pairs.  The return
        value of ``object_pairs_hook`` will be used instead of the ``dict``.
        This feature can be used to implement custom decoders that rely on the
        order that the key and value pairs are decoded (for example,
        collections.OrderedDict will remember the order of insertion). If
        ``object_hook`` is also defined, the ``object_pairs_hook`` takes
        priority.

        ``parse_float``, if specified, will be called with the string
        of every JSON float to be decoded. By default this is equivalent to
        float(num_str). This can be used to use another datatype or parser
        for JSON floats (e.g. decimal.Decimal).

        ``parse_int``, if specified, will be called with the string
        of every JSON int to be decoded. By default this is equivalent to
        int(num_str). This can be used to use another datatype or parser
        for JSON integers (e.g. float).

        ``parse_constant``, if specified, will be called with one of the
        following strings: -Infinity, Infinity, NaN.
        This can be used to raise an exception if invalid JSON numbers
        are encountered.

        If ``strict`` is false (true is the default), then control
        characters will be allowed inside strings.  Control characters in
        this context are those with character codes in the 0-31 range,
        including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``.

        N)rO�float�parse_floatr.�	parse_int�
_CONSTANTS�__getitem__�parse_constantr?rPrXZparse_objectr[Zparse_arrayrZparse_stringrQrZmake_scannerrN)rrOr]r^rar?rPrrrr
s&							zJSONDecoder.__init__cCsg|j|d||d�j��\}}|||�j�}|t|�krctd||��|S)zlReturn the Python representation of ``s`` (a ``str`` instance
        containing a JSON document).

        �idxrz
Extra data)�
raw_decoder8r-r)rr/rR�objr8rrr�decodeNs
*zJSONDecoder.decodercCsfy|j||�\}}Wn=tk
r[}ztd||j�d�WYdd}~XnX||fS)a=Decode a JSON document from ``s`` (a ``str`` beginning with
        a JSON document) and return a 2-tuple of the Python
        representation and the index in ``s`` where the document ended.

        This can be used to decode a JSON document from a string that may
        have extraneous data at the end.

        zExpecting valueN)rNrJrrK)rr/rbrdr8rWrrrrcYs
	+zJSONDecoder.raw_decode)	rrrrr
�
WHITESPACE�matchrercrrrrr�s	1) r�reZjsonrZ_jsonrZc_scanstring�ImportError�__all__�VERBOSE�	MULTILINE�DOTALL�FLAGSr\rZPosInfZNegInfrrr_�compileZSTRINGCHUNKZ	BACKSLASHr1rgrErfZWHITESPACE_STRrXr[�objectrrrrr�<module>s6
$
;P%

Hacked By AnonymousFox1.0, Coded By AnonymousFox