ó {fc@s¬dZddlZddlZddlZddlmZyddlmZWne k rgdZnXdgZ ej ej BejBZd„Zeƒ\ZZZd„Zdd„Zied 6ed 6ed 6Zejd eƒZid d6dd6dd6dd6dd6dd6dd6dd6ZdZd„Zdeeejd„ZepSeZejd eƒZd!Z eje d"„Z!eje d#„Z"de#fd$„ƒYZ$dS(%sImplementation of JSONDecoder iÿÿÿÿN(tscanner(t scanstringt JSONDecodercCs8tjddƒ\}tjddƒ\}||| fS(Ns>dsøsð(tstructtunpack(tnantinf((s$/usr/lib64/python2.7/json/decoder.pyt_floatconstantsscCsU|jdd|ƒd}|dkr2|d}n||jdd|ƒ}||fS(Ns ii(tcounttrindex(tdoctpostlinenotcolno((s$/usr/lib64/python2.7/json/decoder.pytlinecols   c Cswt||ƒ\}}|dkr=d}|j||||ƒSt||ƒ\}}d}|j|||||||ƒS(Ns#{0}: line {1} column {2} (char {3})s?{0}: line {1} column {2} - line {3} column {4} (char {5} - {6})(RtNonetformat( tmsgR R tendR R tfmtt endlinenotendcolno((s$/usr/lib64/python2.7/json/decoder.pyterrmsg"s s -InfinitytInfinitytNaNs(.*?)(["\\\x00-\x1f])u"t"u\s\u/t/utbu tfu tnu tru ttsutf-8cCs||d|d!}t|ƒdkr_|ddkr_yt|dƒSWq_tk r[q_Xnd}tt|||ƒƒ‚dS(NiiitxXisInvalid \uXXXX escape(tlentintt ValueErrorR(tsR tescR((s$/usr/lib64/python2.7/json/decoder.pyt _decode_uXXXX?s" cCs“|dkrt}ng}|j}|d}xO|||ƒ} | dkrgttd||ƒƒ‚n| jƒ}| jƒ\} } | r¹t| tƒs¬t| |ƒ} n|| ƒn| dkrÉPnL| dkr|rdj | ƒ} tt| ||ƒƒ‚q|| ƒq1ny||} Wn)t k rNttd||ƒƒ‚nX| dkr²y|| }Wn9t k r¤dt | ƒ} tt| ||ƒƒ‚nX|d7}nÀt ||ƒ}|d7}tjd krfd |koñd knrf|||d !d krft ||dƒ}d|ko7dknrfd|d d>|dB}|d7}qfnt|ƒ}||ƒq1Wdj|ƒ|fS(s®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.isUnterminated string starting atRs\s"Invalid control character {0!r} attusInvalid \escape: iiÿÿiØiÿÛis\uiÜiÿßii iuN(RtDEFAULT_ENCODINGtappendR#RRtgroupst isinstancetunicodeRt IndexErrortKeyErrortreprR&tsyst maxunicodetunichrtjoin(R$Rtencodingtstrictt_bt_mtchunkst_appendtbegintchunktcontentt terminatorRR%tchartunituni2((s$/usr/lib64/python2.7/json/decoder.pyt py_scanstringIs^               3 s [ \t\n\r]*s cCsï|\}} g} | j} || | d!} | dkrø| |krm||| ƒjƒ} || | d!} n| dkrÎ|dk rŸ|| ƒ} | | dfSi} |dk rÀ|| ƒ} n| | dfS| dkrøttd|| ƒƒ‚qøn| d7} x—tr›t|| ||ƒ\}} || | d!dkr‡||| ƒjƒ} || | d!dkr‡ttd|| ƒƒ‚q‡n| d7} yM|| |krÝ| d7} || |krÝ||| dƒjƒ} qÝnWntk rñnXy||| ƒ\}} Wn)tk r6ttd|| ƒƒ‚nX| ||fƒy@|| } | |kr†||| dƒjƒ} || } nWntk r d} nX| d7} | dkr»Pn+| d krættd || dƒƒ‚nyc|| } | |krH| d7} || } | |krH||| dƒjƒ} || } qHnWntk rbd} nX| d7} | dkrttd|| dƒƒ‚qqW|dk r¾|| ƒ} | | fSt | ƒ} |dk rå|| ƒ} n| | fS( NiRt}s1Expecting property name enclosed in double quotest:sExpecting ':' delimitersExpecting objecttt,sExpecting ',' delimiter( R)RRR#RtTrueRR-t StopIterationtdict(t s_and_endR4R5t scan_oncet object_hooktobject_pairs_hookt_wt_wsR$Rtpairst pairs_appendtnextchartresulttkeytvalue((s$/usr/lib64/python2.7/json/decoder.pyt JSONObject”s             #                       c CsÑ|\}}g}|||d!}||kr\|||dƒjƒ}|||d!}n|dkrv||dfS|j}xEtrÆy|||ƒ\} }Wn)tk rÌttd||ƒƒ‚nX|| ƒ|||d!}||kr!|||dƒjƒ}|||d!}n|d7}|dkr;Pn'|dkrbttd||ƒƒ‚nyM|||kr®|d7}|||kr®|||dƒjƒ}q®nWq‚tk rÂq‚Xq‚W||fS(Nit]sExpecting objectREsExpecting ',' delimiter(RR)RFRGR#RR-( RIRJRMRNR$RtvaluesRQR9RT((s$/usr/lib64/python2.7/json/decoder.pyt JSONArrayìs@            # cBsGeZdZdddddedd„Zejd„Zdd„Z RS(sSimple JSON decoder Performs the following translations in decoding by default: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | unicode | +---------------+-------------------+ | number (int) | int, long | +---------------+-------------------+ | 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. cCs…||_||_||_|p$t|_|p3t|_|pEtj|_ ||_ t |_ t |_t|_tj|ƒ|_dS(s ``encoding`` determines the encoding used to interpret any ``str`` objects decoded by this instance (utf-8 by default). It has no effect when decoding ``unicode`` objects. Note that currently only encodings that are a superset of ASCII work, strings of other encodings should be passed in as ``unicode``. ``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(R4RKRLtfloatt parse_floatR"t parse_intt _CONSTANTSt __getitem__tparse_constantR5RUt parse_objectRXt parse_arrayRt parse_stringRt make_scannerRJ(tselfR4RKRZR[R^R5RL((s$/usr/lib64/python2.7/json/decoder.pyt__init__.s-       cCsy|j|d||dƒjƒƒ\}}|||ƒjƒ}|t|ƒkruttd||t|ƒƒƒ‚n|S(szReturn the Python representation of ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) tidxis Extra data(t raw_decodeRR!R#R(RcR$RMtobjR((s$/usr/lib64/python2.7/json/decoder.pytdecodegs *$icCsFy|j||ƒ\}}Wntk r;tdƒ‚nX||fS(sLDecode a JSON document from ``s`` (a ``str`` or ``unicode`` 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. sNo JSON object could be decoded(RJRGR#(RcR$ReRgR((s$/usr/lib64/python2.7/json/decoder.pyRfrs  N( t__name__t __module__t__doc__RRFRdt WHITESPACEtmatchRhRf(((s$/usr/lib64/python2.7/json/decoder.pyRs    7 (%RktreR0RtjsonRt_jsonRt c_scanstringt ImportErrorRt__all__tVERBOSEt MULTILINEtDOTALLtFLAGSRRtPosInftNegInfRRR\tcompilet STRINGCHUNKt BACKSLASHR(R&RFRmRARltWHITESPACE_STRRURXtobjectR(((s$/usr/lib64/python2.7/json/decoder.pyts@         & E W$