;
Ïâ"Ic               @   sQ  d  Z  d d l Z d d l Z d d l m Z m Z y d d l m Z Wn e	 k
 o d Z Yn Xd g Z e j e j Be j BZ e d ƒ e d ƒ e d ƒ Z Z Z d	 „  Z d d
 „ Z i e d 6e d 6e d 6d, d 6d- d 6d d 6Z e d „ Z e d ƒ e ƒ d „  Z e d ƒ e ƒ e j d e ƒ Z i d d 6d d 6d d 6d d 6d d 6d d 6d d  6d! d" 6Z d# Z d d, e e j d$ „ Z  e d k	 o
 e Z n e  Z d% „  Z! e d ƒ e! ƒ e j d& e ƒ Z" e" j d' „ Z# e d( ƒ e# ƒ e" j d) „ Z$ e d* ƒ e$ ƒ e# e$ e! e e g Z% e e% ƒ Z& Gd+ „  d e' ƒ Z( d S(.   u   Implementation of JSONDecoder
i    N(   u   Scanneru   pattern(   u
   scanstringu   JSONDecoderu   nanu   infu   -infc             C   ss   t  |  t ƒ o
 d } n d } |  j | d | ƒ d } | d k o
 | } n | |  j | d | ƒ } | | f S(   Ns   
u   
i    i   (   u
   isinstanceu   bytesu   countu   rindex(   u   docu   posu   newlineu   linenou   colno(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu   linecol   s    

c       	      C   sy   t  | | ƒ \ } } | d  k o d } | j |  | | | ƒ St  | | ƒ \ } } d } | j |  | | | | | | ƒ S(   Nu#   {0}: line {1} column {2} (char {3})u?   {0}: line {1} column {2} - line {3} column {4} (char {5} - {6})(   u   linecolu   Noneu   format(	   u   msgu   docu   posu   endu   linenou   colnou   fmtu	   endlinenou   endcolno(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu   errmsg!   s    u	   -Infinityu   Infinityu   NaNu   trueu   falseu   nullc             C   sR   |  j  d ƒ } t | d d  ƒ } | d  k o | | } n | | ƒ } | d  f S(   Ni    u   parse_constant(   u   groupu   getattru   None(   u   matchu   contextu   cu   su   fnu   rval(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu   JSONConstant5   s    u    (-?Infinity|NaN|true|false|null)c             C   s¯   t  j j |  j |  j ƒ  Œ }  |  j ƒ  \ } } } | p | o? t | d d  ƒ p t } | | | p d | p d ƒ } n& t | d d  ƒ p t	 } | | ƒ } | d  f S(   Nu   parse_floatu    u	   parse_int(
   u
   JSONNumberu   regexu   matchu   stringu   spanu   groupsu   getattru   Noneu   floatu   int(   u   matchu   contextu   integeru   fracu   expu   fnu   res(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu
   JSONNumber@   s    &u2   (-?(?:0|[1-9][0-9]*))(\.[0-9]+)?([eE][-+]?[0-9]+)?u   (.*?)(["\\\x00-\x1f])u   "u   \u   /u   u   bu   u   fu   
u   nu   u   ru   	u   tu   utf-8c             C   sI  | d  k o
 t } n g  } | j } | d } x| |  | ƒ }	 |	 d  k o t t d |  | ƒ ƒ ‚ n |	 j ƒ  } |	 j ƒ  \ }
 } |
 o1 t |
 t ƒ p t |
 | ƒ }
 n | |
 ƒ n | d k o PnQ | d k oC | o+ d j	 | ƒ } t t | |  | ƒ ƒ ‚ q#| | ƒ q3 n y |  | } Wn, t
 k
 o  t t d |  | ƒ ƒ ‚ Yn X| d k oZ y | | } Wn; t k
 o/ d j	 | ƒ } t t | |  | ƒ ƒ ‚ Yn X| d 7} nc|  | d | d … } | d } d	 } yt | ƒ d
 k o
 t ‚ n t | d ƒ } d | k o
 d k n o« t j d k o› d } |  | d | d … d k p
 t ‚ n |  | d | d … } t | ƒ d
 k o
 t ‚ n t | d ƒ } d | d d >| d B} | d 7} n t | ƒ } Wn, t k
 o  t t | |  | ƒ ƒ ‚ Yn X| } | | ƒ q3 d j | ƒ | f S(   Ni   u   Unterminated string starting atu   "u   \u"   Invalid control character {0!r} atu   uu   Invalid \escape: {0!r}i   u   Invalid \uXXXX escapei   i   i Ø  iÿÛ  iÿÿ  u#   Invalid \uXXXX\uXXXX surrogate pairi   u   \ui   i   i
   i Ü  i   u    (   u   Noneu   DEFAULT_ENCODINGu   appendu
   ValueErroru   errmsgu   endu   groupsu
   isinstanceu   stru   formatu
   IndexErroru   KeyErroru   lenu   intu   sysu
   maxunicodeu   chru   join(   u   su   endu   encodingu   strictu   _bu   _mu   chunksu   _appendu   beginu   chunku   contentu
   terminatoru   msgu   escu   mu   next_endu   uniu   esc2u   uni2(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu   py_scanstringV   sv    
	



.

c             C   s@   t  | d d  ƒ } t  | d d ƒ } t |  j |  j ƒ  | | ƒ S(   Nu   encodingu   strictT(   u   getattru   Noneu   Trueu
   scanstringu   stringu   end(   u   matchu   contextu   encodingu   strict(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu
   JSONStringœ   s    u   \s*c             C   s¬  i  } |  j  } | | |  j ƒ  ƒ j ƒ  } | | | d … } | d k o | | d f S| d k o t t d | | ƒ ƒ ‚ n | d 7} t | d d  ƒ } t | d d ƒ } t j }	 x¶t	 | | | | ƒ \ }
 } | | | ƒ j ƒ  } | | | d … d k o t t d | | ƒ ƒ ‚ n | | | d ƒ j ƒ  } y( t
 |	 | d	 | d
 | ƒƒ \ } } Wn, t k
 o  t t d | | ƒ ƒ ‚ Yn X| | |
 <| | | ƒ j ƒ  } | | | d … } | d 7} | d k o Pn | d k o  t t d | | d ƒ ƒ ‚ n | | | ƒ j ƒ  } | | | d … } | d 7} | d k o  t t d | | d ƒ ƒ ‚ q½ q½ t | d d  ƒ } | d  k	 o | | ƒ } n | | f S(   Ni   u   }u   "u   Expecting property nameu   encodingu   strictu   :u   Expecting : delimiteru   idxu   contextu   Expecting objectu   ,u   Expecting , delimiteru   object_hookT(   u   stringu   endu
   ValueErroru   errmsgu   getattru   Noneu   Trueu   JSONScanneru   iterscanu
   scanstringu   nextu   StopIteration(   u   matchu   contextu   _wu   pairsu   su   endu   nextcharu   encodingu   strictu   iterscanu   keyu   valueu   object_hook(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu
   JSONObject¦   sN    	
	(

 
#u   {c       	      C   sZ  g  } |  j  } | | |  j ƒ  ƒ j ƒ  } | | | d … } | d k o | | d f St j } xê y( t | | d | d | ƒƒ \ } } Wn, t k
 o  t t d | | ƒ ƒ ‚ Yn X| j | ƒ | | | ƒ j ƒ  } | | | d … } | d 7} | d k o Pn | d k o t t d | | ƒ ƒ ‚ n | | | ƒ j ƒ  } qf | | f S(   Ni   u   ]u   idxu   contextu   Expecting objectu   ,u   Expecting , delimiter(	   u   stringu   endu   JSONScanneru   iterscanu   nextu   StopIterationu
   ValueErroru   errmsgu   append(	   u   matchu   contextu   _wu   valuesu   su   endu   nextcharu   iterscanu   value(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu	   JSONArrayÒ   s,    		(
u   \[c             B   sb   |  Ee  Z d  Z e e ƒ Z d d d g Z d d d d d d d „ Z	 e
 j d „ Z d „  Z d S(	   u  Simple JSON <http://json.org> 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.
    u   __init__u   decodeu
   raw_decodec             C   s:   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ d S(   uy  ``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).

        ``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, null, true, false.
        This can be used to raise an exception if invalid JSON numbers
        are encountered.

        N(   u   encodingu   object_hooku   parse_floatu	   parse_intu   parse_constantu   strict(   u   selfu   encodingu   object_hooku   parse_floatu	   parse_intu   parse_constantu   strict(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu   __init__  s    					c             C   s{   |  j  | d | | d ƒ j ƒ  ƒ\ } } | | | ƒ j ƒ  } | t | ƒ k o% t t d | | t | ƒ ƒ ƒ ‚ n | S(   uƒ   
        Return the Python representation of ``s`` (a ``str`` or ``unicode``
        instance containing a JSON document)

        u   idxi    u
   Extra data(   u
   raw_decodeu   endu   lenu
   ValueErroru   errmsg(   u   selfu   su   _wu   obju   end(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu   decode=  s
    *%c          
   K   sb   | j  d |  ƒ y% t |  j j | |  ƒ \ } } Wn  t k
 o t d ƒ ‚ Yn X| | f S(   uL  Decode 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.

        u   contextu   No JSON object could be decoded(   u
   setdefaultu   nextu   _scanneru   iterscanu   StopIterationu
   ValueError(   u   selfu   su   kwu   obju   end(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu
   raw_decodeI  s    	%NT(   u   __name__u
   __module__u   __doc__u   Scanneru   ANYTHINGu   _scanneru   __all__u   Noneu   Trueu   __init__u
   WHITESPACEu   matchu   decodeu
   raw_decode(   u
   __locals__(    (    u)   /mit/python/lib/python3.0/json/decoder.pyu   JSONDecoderø   s   
	$TF()   u   __doc__u   reu   sysu   json.scanneru   Scanneru   patternu   _jsonu
   scanstringu   c_scanstringu   ImportErroru   Noneu   __all__u   VERBOSEu	   MULTILINEu   DOTALLu   FLAGSu   floatu   NaNu   PosInfu   NegInfu   linecolu   errmsgu   Trueu   Falseu
   _CONSTANTSu   JSONConstantu
   JSONNumberu   compileu   STRINGCHUNKu	   BACKSLASHu   DEFAULT_ENCODINGu   matchu   py_scanstringu
   JSONStringu
   WHITESPACEu
   JSONObjectu	   JSONArrayu   ANYTHINGu   JSONScanneru   objectu   JSONDecoder(    (    (    u)   /mit/python/lib/python3.0/json/decoder.pyu   <module>   s\   	&	

	
&A
	)	