%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core20/2318/lib/python3.8/json/__pycache__/
Upload File :
Create Path :
Current File : //snap/core20/2318/lib/python3.8/json/__pycache__/decoder.cpython-38.pyc

U

k�]e�0�	@sdZddlZddlmZzddlmZWnek
r@dZYnXddgZej	ej
BejBZe
d�Ze
d�Ze
d	�ZGd
d�de�Zeeed�Ze�de�Zd
dddddddd�Zdd�Zdeejfdd�Zep�eZe�de�ZdZdejefdd�Zejefdd �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

    cCsb|�dd|�d}||�dd|�}d||||f}t�||�||_||_||_||_||_dS)N�
r�z%s: line %d column %d (char %d))	�count�rfind�
ValueError�__init__�msg�doc�pos�lineno�colno)�selfrrrrr�errmsg�r�"/usr/lib/python3.8/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])�"�\�/��r�
�	)rrr �b�f�n�r�tcCsb||d|d�}t|�dkrN|ddkrNzt|d�WStk
rLYnXd}t|||��dS)Nr	��ZxX�zInvalid \uXXXX escape)�len�intrr)�sr�escrrrr�
_decode_uXXXX;sr1TcCs�g}|j}|d}|||�}|dkr0td||��|��}|��\}	}
|	rP||	�|
dkr^�q�n.|
dkr�|r�d�|
�}t|||��n
||
�qz||}Wn"tk
r�td||�d�YnX|dk�rz||}
Wn*tk
r�d�|�}t|||��YnX|d7}n�t||�}|d	7}d
|k�r2dk�r�nn`|||d�d
k�r�t||d�}d|k�rrdk�r�nn d|d
d>|dB}|d7}t|�}
||
�qd�	|�|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_scanstringEsX


��



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

c
Cs�|\}}	g}
|
j}|dkri}|j}||	|	d�}
|
dkr�|
|krb|||	���}	||	|	d�}
|
dkr�|dk	r�||
�}||	dfSi}
|dk	r�||
�}
|
|	dfS|
dkr�td||	��|	d7}	t||	|�\}}	|||�}||	|	d�dk�r"|||	���}	||	|	d�dk�r"td||	��|	d7}	z:||	|k�rb|	d7}	||	|k�rb|||	d���}	Wntk
�rzYnXz|||	�\}}	Wn4tk
�r�}ztd||j�d�W5d}~XYnX|||f�z0||	}
|
|k�r�|||	d���}	||	}
Wntk
�rd}
YnX|	d7}	|
dk�r4�q�n|
d	k�rNtd
||	d��|||	���}	||	|	d�}
|	d7}	|
dkr�td||	d��q�|dk	�r�||
�}||	fSt|
�}
|dk	�r�||
�}
|
|	fS)Nr	r�}z1Expecting property name enclosed in double quotes�:zExpecting ':' delimiter�Expecting valuer6�,�Expecting ',' 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�keyrM�errrrr�
JSONObject�s��
"



�

rZc
Cst|\}}g}|||d�}||krF|||d���}|||d�}|dkrZ||dfS|j}z|||�\}	}Wn2tk
r�}
ztd||
j�d�W5d}
~
XYnX||	�|||d�}||kr�|||d���}|||d�}|d7}|dkr��qln|dk�rtd||d��z:|||k�rP|d7}|||k�rP|||d���}Wq`tk
�rhYq`Xq`||fS)Nr	�]rHrIrJ)r8r7rLrrMr;)rOrPrTrUr/r8�valuesrVrArMrYrrr�	JSONArray�s>"
r]c@s@eZdZdZddddddd�dd�Zejfdd�Zdd
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.

    NT)rQ�parse_float�	parse_int�parse_constantr?rRcCsZ||_|pt|_|pt|_|p"tj|_||_||_	t
|_t|_
t|_i|_t�|�|_dS)a�``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.
        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)rQ�floatr^r.r_�
_CONSTANTS�__getitem__r`r?rRrZZparse_objectr]Zparse_arrayrZparse_stringrSrZmake_scannerrP)rrQr^r_r`r?rRrrrr
s#

zJSONDecoder.__init__cCsF|j|||d���d�\}}|||���}|t|�krBtd||��|S)zlReturn the Python representation of ``s`` (a ``str`` instance
        containing a JSON document).

        r)�idxz
Extra data)�
raw_decoder8r-r)rr/rT�objr8rrr�decodeLs
zJSONDecoder.decoderc
CsPz|�||�\}}Wn2tk
rF}ztd||j�d�W5d}~XYnX||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.

        rHN)rPrLrrM)rr/rdrfr8rYrrrreWs
	"zJSONDecoder.raw_decode)r)	rrrrr
�
WHITESPACE�matchrgrerrrrr�s�0) r�reZjsonrZ_jsonrZc_scanstring�ImportError�__all__�VERBOSE�	MULTILINE�DOTALL�FLAGSrarZPosInfZNegInfrrrb�compileZSTRINGCHUNKZ	BACKSLASHr1rirErhZWHITESPACE_STRrZr]�objectrrrrr�<module>sP
��
�
=�
Q%

Zerion Mini Shell 1.0