
    efCd                         % S SK JrJrJrJrJrJr  S SKrS SKJ	r	J
r
JrJrJr  \\4r\	\S4   \S'   \" S S 5       5      r " S S	5      r " S
 S5      r\R,                  " \5        \R,                  " \5        g)    )MutableMappingMappingMutableSequenceIteratorSequence	ContainerN)TupleAnyDictSetList.str_typec              #   $   #    U  H  ov   M     g 7fN ).0_s     3/usr/lib/python3/dist-packages/pyparsing/results.py	<genexpr>r      s     2a2s   r   c                   T    \ rS rSr% \S\4   \S'   S/rSSS\4S jrS r	S r
S	 rS
rg)_ParseResultsWithOffset   ParseResultstupp1p2c                     X4U l         g r   r   )selfr   r   s      r   __init__ _ParseResultsWithOffset.__init__   s    .0X    c                      U R                   U   $ r   r   r   is     r   __getitem__#_ParseResultsWithOffset.__getitem__   s    xx{r"   c                     U R                   $ r   r   r   s    r   __getstate__$_ParseResultsWithOffset.__getstate__   s    xxr"   c                     US   U l         g Nr   r   )r   argss     r   __setstate__$_ParseResultsWithOffset.__setstate__   s    7r"   r   N)__name__
__module____qualname____firstlineno__r	   int__annotations__	__slots__r    r&   r*   r/   __static_attributes__r   r"   r   r   r      s;    	~s"	##I6> 6s 6r"   r   c                   @   \ rS rSr% SrS/ S4r\\S4   \S'   \	\S'   S \S'   \
\	   \S	'   \\S
'   \\   \S'   \\	\4   \S'   Sr " S S\5      rS:S jrSSSS\4S jrS r\4S jrS rS\4S jrS\4S jrS\4S jrS\4S jrS\4S jrS rS rS rS\4S jr S  r!S;S! jr"S" r#S# r$S$ r%S% r&S& r'S<S' jr(S<S( jr)S=S) jr*S\	4S* jr+S\	4S+ jr,S>S, jr-S\4S- jr.S\/4S. jr0S=S/ jr1S=S0 jr2S1 r3S?S\	4S2 jjr4S3 r5S4 r6S5 r7S6 r8S7 r9\:S;S=S8 jj5       r;\.r< \0r= \3r>S9r?g)@r   "   a  Structured parse results, to provide multiple means of access to
the parsed data:

- as a list (``len(results)``)
- by list index (``results[0], results[1]``, etc.)
- by attribute (``results.<results_name>`` - see :class:`ParserElement.set_results_name`)

Example::

    integer = Word(nums)
    date_str = (integer.set_results_name("year") + '/'
                + integer.set_results_name("month") + '/'
                + integer.set_results_name("day"))
    # equivalent form:
    # date_str = (integer("year") + '/'
    #             + integer("month") + '/'
    #             + integer("day"))

    # parse_string returns a ParseResults object
    result = date_str.parse_string("1999/12/31")

    def test(s, fn=repr):
        print(f"{s} -> {fn(eval(s))}")
    test("list(result)")
    test("result[0]")
    test("result['month']")
    test("result.day")
    test("'month' in result")
    test("'minutes' in result")
    test("result.dump()", str)

prints::

    list(result) -> ['1999', '/', '12', '/', '31']
    result[0] -> '1999'
    result['month'] -> '12'
    result.day -> '31'
    'month' in result -> True
    'minutes' in result -> False
    result.dump() -> ['1999', '/', '12', '/', '31']
    - day: '31'
    - month: '12'
    - year: '1999'
Nr   ._null_values_name_parent
_all_names_modal_toklist_tokdict)r<   r=   r>   r?   r@   rA   c                   "    \ rS rSrSrSS jrSrg)ParseResults.Listb   a  
Simple wrapper class to distinguish parsed list results that should be preserved
as actual Python lists, instead of being converted to :class:`ParseResults`::

    LBRACK, RBRACK = map(pp.Suppress, "[]")
    element = pp.Forward()
    item = ppc.integer
    element_list = LBRACK + pp.DelimitedList(element) + RBRACK

    # add parse actions to convert from ParseResults to actual Python collection types
    def as_python_list(t):
        return pp.ParseResults.List(t.as_list())
    element_list.add_parse_action(as_python_list)

    element <<= item | element_list

    element.run_tests('''
        100
        [2,3,4]
        [[2, 1],3,4]
        [(2, 1),3,4]
        (2,3,4)
        ''', post_parse=lambda s, r: (r[0], type(r[0])))

prints::

    100
    (100, <class 'int'>)

    [2,3,4]
    ([2, 3, 4], <class 'list'>)

    [[2, 1],3,4]
    ([[2, 1], 3, 4], <class 'list'>)

(Used internally by :class:`Group` when `aslist=True`.)
Nc                     Uc  / n[        U[        5      (       d-  [        U R                   S[	        U5      R                   35      e[        R                  U 5      $ )Nz* may only be constructed with a list, not )
isinstancelist	TypeErrorr1   type__new__)cls	containeds     r   rJ   ParseResults.List.__new__   sW     	i..||n$NtT]OgOgNhi  <<$$r"   r   r   )r1   r2   r3   r4   __doc__rJ   r8   r   r"   r   r   rC   b   s    $	L		%r"   r   c                 ~   [        U[        5      (       a  U$ [        R                  U 5      nS Ul        S Ul        [        5       Ul        Uc  / Ul        OY[        U[        [        45      (       a6  [        U[        R                  5      (       a  US S  /O
[        U5      Ul        OU/Ul        [        5       Ul        U$ r   )rF   r   objectrJ   r<   r=   setr>   r@   rG   _generator_typer   dictrA   )rK   toklistnamekwargsr   s        r   rJ   ParseResults.__new__   s    g|,,N~~c"
%?DM$!899 g|'8'899 '] M %IDMr"   Tc                    U   X@l         Ub  US:X  a  g U" U[        5      (       a  [        U5      nU(       d  U1U l        X l        XR
                  ;   a  g U" U[        [        45      (       a  U/nU(       aX  U" U[        5      (       a"  [        [        UR                  5      S5      X'   O[        [        US   5      S5      X'   X U   l        g  US   X'   g ! [        [        [        4 a    XLa  XU'    g X l         g f = f)N r   )r?   r5   strr>   r<   r;   r   rI   r   r   r@   KeyErrorrH   
IndexError)r   rT   rU   asListmodalrF   s         r   r    ParseResults.__init__   s     	<42:dC  t9D#fDO
'''g$/00iG'<004\'BRBR5SUVW
4\'!*5MqQ
#J	" DJ)Z0 	""$T
!
		"s   C D 7D ?D c                     [        U[        [        45      (       a  U R                  U   $ XR                  ;  a  U R
                  U   S   S   $ [        U R
                  U    Vs/ s H  o"S   PM	     sn5      $ s  snf )Nr   )rF   r5   slicer@   r>   rA   r   )r   r%   vs      r   r&   ParseResults.__getitem__   so    a#u&&==##OO#==#B'**4==+;<+;aqT+;<==<s   %A:c                    U" U[         5      (       a;  U R                  R                  U[        5       5      U/-   U R                  U'   US   nOjU" U[        [
        45      (       a  X R                  U'   UnOAU R                  R                  U[        5       5      [        US5      /-   U R                  U'   UnU" U[        5      (       a  Xl        g g r-   )	r   rA   getrG   r5   rb   r@   r   r=   )r   krc   rF   subs        r   __setitem__ParseResults.__setitem__   s    a011#}}00DF;qcADMM!A$CC<(( MM!C#}}00DF;'1-?  DMM! Cc<((K )r"   c           	         [        U[        [        45      (       d  U R                  U	 g [	        U R
                  5      nU R
                  U	 [        U[        5      (       a  US:  a  X-  n[        XS-   5      n[        [        UR                  U5      6 5      nUR                  5         U R                  R                  5        H5  nU H,  n[        U5       H  u  nu  px[        XxX:  -
  5      XF'   M     M.     M7     g )Nr      )rF   r5   rb   rA   lenr@   rG   rangeindicesreversevalues	enumerater   )	r   r%   mylenremovedoccurrencesjrg   valuepositions	            r   __delitem__ParseResults.__delitem__   s    !c5\**a DMM"MM! a1u
aQAuaii./0==//1K,5k,B(A(%<8<8&KN -C  2r"   returnc                     XR                   ;   $ r   rA   )r   rg   s     r   __contains__ParseResults.__contains__  s    MM!!r"   c                 ,    [        U R                  5      $ r   )rm   r@   r)   s    r   __len__ParseResults.__len__  s    4==!!r"   c                 H    U R                   =(       d    U R                  (       $ r   )r@   rA   r)   s    r   __bool__ParseResults.__bool__  s    677r"   c                 ,    [        U R                  5      $ r   iterr@   r)   s    r   __iter__ParseResults.__iter__      DMM""r"   c                 8    [        U R                  S S S2   5      $ )Nra   r   r)   s    r   __reversed__ParseResults.__reversed__  s    DMM$B$'((r"   c                 ,    [        U R                  5      $ r   )r   rA   r)   s    r   keysParseResults.keys  r   r"   c                 8   ^  U 4S jT R                  5        5       $ )Nc              3   .   >#    U  H
  nTU   v   M     g 7fr   r   r   rg   r   s     r   r   &ParseResults.values.<locals>.<genexpr>  s     -AQs   r   r)   s   `r   rq   ParseResults.values  s    ---r"   c                 8   ^  U 4S jT R                  5        5       $ )Nc              3   0   >#    U  H  oTU   4v   M     g 7fr   r   r   s     r   r   %ParseResults.items.<locals>.<genexpr>  s     2kDGks   r   r)   s   `r   itemsParseResults.items  s    2diik22r"   c                 "    U R                   (       $ )z
Since ``keys()`` returns an iterator, this method is helpful in bypassing
code that looks for the existence of any defined results names.r}   r)   s    r   haskeysParseResults.haskeys  s     }}$$r"   c                    U(       d  S/nUR                  5        H!  u  p4US:X  a	  US   U4nM  [        SU< 35      e   [        US   [        5      (       d  [	        U5      S:X  d	  US   U ;   a  US   nX   nX	 U$ US   nU$ )a  
Removes and returns item at specified index (default= ``last``).
Supports both ``list`` and ``dict`` semantics for ``pop()``. If
passed no argument or an integer argument, it will use ``list``
semantics and pop tokens from the list of parsed tokens. If passed
a non-integer argument (most likely a string), it will use ``dict``
semantics and pop the corresponding value from any defined results
names. A second default return value argument is supported, just as in
``dict.pop()``.

Example::

    numlist = Word(nums)[...]
    print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321']

    def remove_first(tokens):
        tokens.pop(0)
    numlist.add_parse_action(remove_first)
    print(numlist.parse_string("0 123 321")) # -> ['123', '321']

    label = Word(alphas)
    patt = label("LABEL") + Word(nums)[1, ...]
    print(patt.parse_string("AAB 123 321").dump())

    # Use pop() in a parse action to remove named result (note that corresponding value is not
    # removed from list form of results)
    def remove_LABEL(tokens):
        tokens.pop("LABEL")
        return tokens
    patt.add_parse_action(remove_LABEL)
    print(patt.parse_string("AAB 123 321").dump())

prints::

    ['AAB', '123', '321']
    - LABEL: 'AAB'

    ['AAB', '123', '321']
ra   defaultr   z)pop() got an unexpected keyword argument rl   )r   rH   rF   r5   rm   )r   r.   rV   rg   rc   indexretdefaultvalues           r   popParseResults.pop   s    P 4DLLNDAI~Q|"KA5 QRR	 #
 d1gs##s4yA~aDGE+CJ7Lr"   c                     X;   a  X   $ U$ )a  
Returns named result matching the given key, or if there is no
such name, then returns the given ``default_value`` or ``None`` if no
``default_value`` is specified.

Similar to ``dict.get()``.

Example::

    integer = Word(nums)
    date_str = integer("year") + '/' + integer("month") + '/' + integer("day")

    result = date_str.parse_string("1999/12/31")
    print(result.get("year")) # -> '1999'
    print(result.get("hour", "not specified")) # -> 'not specified'
    print(result.get("hour")) # -> None
r   )r   keydefault_values      r   rf   ParseResults.getX  s    $ ;9  r"   c                     U R                   R                  X5        U R                  R                  5        H,  n[	        U5       H  u  nu  pV[        XVXa:  -   5      X4'   M     M.     g)a  
Inserts new element at location index in the list of parsed tokens.

Similar to ``list.insert()``.

Example::

    numlist = Word(nums)[...]
    print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321']

    # use a parse action to insert the parse location in the front of the parsed results
    def insert_locn(locn, tokens):
        tokens.insert(0, locn)
    numlist.add_parse_action(insert_locn)
    print(numlist.parse_string("0 123 321")) # -> [0, '0', '123', '321']
N)r@   insertrA   rq   rr   r   )r   r   
ins_stringru   rg   rw   rx   s          r   r   ParseResults.inserto  s[    " 	U/==//1K(1+(>$$E!8x'78" )? 2r"   c                 :    U R                   R                  U5        g)a  
Add single element to end of ``ParseResults`` list of elements.

Example::

    numlist = Word(nums)[...]
    print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321']

    # use a parse action to compute the sum of the parsed integers, and add it to the end
    def append_sum(tokens):
        tokens.append(sum(map(int, tokens)))
    numlist.add_parse_action(append_sum)
    print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321', 444]
N)r@   append)r   items     r   r   ParseResults.append  s     	T"r"   c                     [        U[        5      (       a  U R                  U5        gU R                  R	                  U5        g)a  
Add sequence of elements to end of ``ParseResults`` list of elements.

Example::

    patt = Word(alphas)[1, ...]

    # use a parse action to append the reverse of the matched strings, to make a palindrome
    def make_palindrome(tokens):
        tokens.extend(reversed([t[::-1] for t in tokens]))
        return ''.join(tokens)
    patt.add_parse_action(make_palindrome)
    print(patt.parse_string("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl'
N)rF   r   __iadd__r@   extend)r   itemseqs     r   r   ParseResults.extend  s/     g|,,MM'"MM  )r"   c                 V    U R                   SS2	 U R                  R                  5         g)z'
Clear all elements and results names.
N)r@   rA   clearr)   s    r   r   ParseResults.clear  s      MM!r"   c                 n     X   $ ! [          a$    UR                  S5      (       a  [        U5      e gf = f)N__rY   )r[   
startswithAttributeError)r   rU   s     r   __getattr__ParseResults.__getattr__  s;    	: 	t$$$T**	s    +44c                 .    U R                  5       nX!-  nU$ r   )copy)r   otherr   s      r   __add__ParseResults.__add__  s    iik
r"   c                   ^ U(       d  U $ UR                   (       a  [        U R                  5      mU4S jnUR                   R                  5       nU VVVs/ s H)  u  pEU  H  nU[	        US   U" US   5      5      4PM     M+     nnnnU H,  u  pFX`U'   [        US   [        5      (       d  M#  XS   l        M.     U =R                  UR                  -  sl        U =R                  UR                  -  sl        U $ s  snnnf )Nc                    > U S:  a  T$ U T-   $ r-   r   )aoffsets    r   <lambda>'ParseResults.__iadd__.<locals>.<lambda>  s    AE&"Aq6z"Ar"   r   rl   )	rA   rm   r@   r   r   rF   r   r=   r>   )	r   r   	addoffset
otheritemsrg   vlistrc   otherdictitemsr   s	           @r   r   ParseResults.__iadd__  s    K>>'FAI--/J !+ *HAA +AaD)AaD/BC D *  
 'QadL11#'aDL '
 	'5+++s   0C=c                 `    [        U[        5      (       a  US:X  a  U R                  5       $ X-   $ r-   )rF   r5   r   )r   r   s     r   __radd__ParseResults.__radd__  s+    eS!!eqj99; <r"   c                 p    [        U 5      R                   SU R                  < SU R                  5        S3$ )N(, ))rI   r1   r@   as_dictr)   s    r   __repr__ParseResults.__repr__  s2    t*%%&a'84<<>:J!LLr"   c           
          SSR                  U R                   Vs/ s H.  n[        U[        5      (       a  [	        U5      O
[        U5      PM0     sn5      -   S-   $ s  snf )N[r   ])joinr@   rF   r   rZ   reprr$   s     r   __str__ParseResults.__str__  sd    ii "]]* )L99CFtAwF* 		
s   5A
c                     / nU R                    He  nU(       a  U(       a  UR                  U5        [        U[        5      (       a  X#R	                  5       -  nMK  UR                  [        U5      5        Mg     U$ r   )r@   r   rF   r   _asStringListrZ   )r   sepoutr   s       r   r   ParseResults._asStringList  sZ    MMDs

3$--))++

3t9% " 
r"   c                     U R                    Vs/ s H*  n[        U[        5      (       a  UR                  5       OUPM,     sn$ s  snf )a(  
Returns the parse results as a nested list of matching tokens, all converted to strings.

Example::

    patt = Word(alphas)[1, ...]
    result = patt.parse_string("sldkj lsdkj sldkj")
    # even though the result prints in string-like form, it is actually a pyparsing ParseResults
    print(type(result), result) # -> <class 'pyparsing.ParseResults'> ['sldkj', 'lsdkj', 'sldkj']

    # Use as_list() to create an actual list
    result_list = result.as_list()
    print(type(result_list), result_list) # -> <class 'list'> ['sldkj', 'lsdkj', 'sldkj']
)r@   rF   r   as_list)r   ress     r   r   ParseResults.as_list  sD    " }}
$ (\::CKKMC$
 	
 
s   1Ac                 V   ^ U4S jm[        U4S jU R                  5        5       5      $ )aG  
Returns the named parse results as a nested dictionary.

Example::

    integer = Word(nums)
    date_str = integer("year") + '/' + integer("month") + '/' + integer("day")

    result = date_str.parse_string('12/31/1999')
    print(type(result), repr(result)) # -> <class 'pyparsing.ParseResults'> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]})

    result_dict = result.as_dict()
    print(type(result_dict), repr(result_dict)) # -> <class 'dict'> {'day': '1999', 'year': '12', 'month': '31'}

    # even though a ParseResults supports dict-like access, sometime you just need to have a dict
    import json
    print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable
    print(json.dumps(result.as_dict())) # -> {"month": "31", "day": "1999", "year": "12"}
c                    > [        U [        5      (       a>  U R                  5       (       a  U R                  5       $ U  Vs/ s H  nT" U5      PM     sn$ U $ s  snf r   )rF   r   r   r   )objrc   to_items     r   r   %ParseResults.as_dict.<locals>.to_item"  sL    #|,,(+s{{}TPS;TPS1GAJPS;TT
 <Us    Ac              3   <   >#    U  H  u  pUT" U5      4v   M     g 7fr   r   )r   rg   rc   r   s      r   r   'ParseResults.as_dict.<locals>.<genexpr>(  s     =Q
Os   )rS   r   )r   r   s    @r   r   ParseResults.as_dict  s!    *	 =

===r"   c                     [        U R                  5      nU R                  R                  5       Ul        U R                  Ul        U=R
                  U R
                  -  sl        U R                  Ul        U$ )z
Returns a new shallow copy of a :class:`ParseResults` object. `ParseResults`
items contained within the source are shared with the copy. Use
:class:`ParseResults.deepcopy()` to create a copy with its own separate
content values.
)r   r@   rA   r   r=   r>   r<   )r   r   s     r   r   ParseResults.copy*  sS     4==)}}))+ll$//)JJ	
r"   c                 p   U R                  5       n[        U R                  5       GH  u  p#[        U[        5      (       a  UR                  5       U R                  U'   M:  [        U[        [        45      (       a  MW  [        U[        5      (       ac  [        U5      " 5       =U R                  U'   nUR                  5        H.  u  pV[        U[        5      (       a  UR                  5       OUXE'   M0     M  [        U[        5      (       d  M  [        U5      " S U 5       5      U R                  U'   GM     U$ )z<
Returns a new deep copy of a :class:`ParseResults` object.
c              3   p   #    U  H,  n[        U[        5      (       a  UR                  5       OUv   M.     g 7fr   )rF   r   deepcopy)r   rc   s     r   r   (ParseResults.deepcopy.<locals>.<genexpr>H  s+      -PS1Jq,$?$?AJJLQFPSs   46)r   rr   r@   rF   r   r   rZ   bytesr   rI   r   r   )r   r   r%   r   destrg   rc   s          r   r   ParseResults.deepcopy8  s     iik.FA#|,,#&<<>a C#u..C00*.s)+5a 4IIKDA.8L.I.IajjlqDG (C++#'9 -PS- $a  / 
r"   c                   ^  T R                   (       a  T R                   $ T R                  (       a<  T R                  nUR                  R                  5       n[	        U 4S jU 5       S5      $ [        T 5      S:X  a{  [        T R                  5      S:X  ab  [	        [        T R                  R                  5       5      5      S   S   S;   a,  [	        [        T R                  R                  5       5      5      $ g)a  
Returns the results name for this token expression. Useful when several
different expressions might match at a particular location.

Example::

    integer = Word(nums)
    ssn_expr = Regex(r"\d\d\d-\d\d-\d\d\d\d")
    house_number_expr = Suppress('#') + Word(nums, alphanums)
    user_data = (Group(house_number_expr)("house_number")
                | Group(ssn_expr)("ssn")
                | Group(integer)("age"))
    user_info = user_data[1, ...]

    result = user_info.parse_string("22 111-22-3333 #221B")
    for item in result:
        print(item.get_name(), ':', item[0])

prints::

    age : 22
    ssn : 111-22-3333
    house_number : 221B
c              3   R   >#    U  H  u  pU  H  u  p4UTL d  M  Uv   M     M     g 7fr   r   )r   rg   r   rc   locr   s        r   r   (ParseResults.get_name.<locals>.<genexpr>l  s2      $8"'Dy A"' $8s   ''Nrl   r   )r   ra   )	r<   r=   rA   r   nextrm   r   rq   r   )r   parparent_tokdict_itemss   `  r   get_nameParseResults.get_nameM  s    2 ::::\\"&,,C#&<<#5#5#7 $8   INDMM"a'T$--..01215a8GCT]]//1233r"   c                     / nSnUR                  U(       a  U[        U R                  5       5      -   OS5        U(       d  SR                  U5      $ U R	                  5       (       a  [        S U R                  5        5       5      nU H  u  pU(       a  UR                  U5        UR                  U SU-   SU S35        [        U	[        5      (       d  UR                  [        U	5      5        Mj  U	(       d  UR                  [        U	5      5        M  UR                  U	R                  UUUUS-   S95        M     [        S	 U  5       5      (       d  SR                  U5      $ U n	Sn
Sn[        U	5       H  u  p[        U[        5      (       aA  UR                  UUUUS-   S9nUR                  U U X-   S
U SU U XS-   -   U 3
5        M[  UR                  U U X-   S
U SU U XS-   -   U 3
5        M     SR                  U5      $ )a  
Diagnostic method for listing out the contents of
a :class:`ParseResults`. Accepts an optional ``indent`` argument so
that this string can be embedded in a nested display of other data.

Example::

    integer = Word(nums)
    date_str = integer("year") + '/' + integer("month") + '/' + integer("day")

    result = date_str.parse_string('1999/12/31')
    print(result.dump())

prints::

    ['1999', '/', '12', '/', '31']
    - day: '31'
    - month: '12'
    - year: '1999'

rY   c              3   @   #    U  H  u  p[        U5      U4v   M     g 7fr   )rZ   )r   rg   rc   s      r   r   $ParseResults.dump.<locals>.<genexpr>  s     @<41CFA;<s   z  z- z: rl   )indentfullinclude_list_depthc              3   B   #    U  H  n[        U[        5      v   M     g 7fr   )rF   r   )r   vvs     r   r   r    s     ?$B:b,//$s   r   z]:)r   rZ   r   r   r   sortedr   rF   r   r   dumpanyrr   )r   r	  r
  r  r  r   NLr   rg   rc   incrnlr%   r  vv_dumps                  r   r  ParseResults.dump}  s   * 

<6C//RH773<<<>>@4::<@@EJJrN

fXtf}%6b2>?!!\22JJtAw'JJs1v&

FF%!%1%z	   ( ?$???773<q\EA"l++''!!-!A:	 "  

d6(4=/1#RtF8DUVJDWCXY`Xab 

d6(4=/1#RtF8DUVJDWCXY[X\] "  wws|r"   c                 T    [         R                   " U R                  5       /UQ70 UD6  g)a  
Pretty-printer for parsed results as a list, using the
`pprint <https://docs.python.org/3/library/pprint.html>`_ module.
Accepts additional positional or keyword args as defined for
`pprint.pprint <https://docs.python.org/3/library/pprint.html#pprint.pprint>`_ .

Example::

    ident = Word(alphas, alphanums)
    num = Word(nums)
    func = Forward()
    term = ident | num | Group('(' + func + ')')
    func <<= ident + Group(Optional(DelimitedList(term)))
    result = func.parse_string("fna a,b,(fnb c,d,200),100")
    result.pprint(width=40)

prints::

    ['fna',
     ['a',
      'b',
      ['(', 'fnb', ['c', 'd', '200'], ')'],
      '100']]
N)pprintr   )r   r.   rV   s      r   r  ParseResults.pprint  s     2 	dlln6t6v6r"   c                 ~    U R                   U R                  R                  5       S U R                  U R                  44$ r   )r@   rA   r   r>   r<   r)   s    r   r*   ParseResults.__getstate__  s9    MM""$

	
 	
r"   c                 b    Uu  U l         u  U l        p#U l        [        U5      U l        S U l        g r   )r@   rA   r<   rQ   r>   r=   )r   stater  inAccumNamess       r   r/   ParseResults.__setstate__  s,    HMEEs$*l+r"   c                 2    U R                   U R                  4$ r   )r@   r<   r)   s    r   __getnewargs__ParseResults.__getnewargs__  s    }}djj((r"   c                 ^    [        [        U 5      5      [        U R                  5       5      -   $ r   )dirrI   rG   r   r)   s    r   __dir__ParseResults.__dir__  s     4:diik!222r"   c           	          S nU " / 5      nUR                  5        H=  u  pV[        U[        5      (       a  X@R                  XeS9-  nM-  X@" U/XS" U5      S9-  nM?     Ub  U " U/US9nU$ )z
Helper classmethod to construct a ``ParseResults`` from a ``dict``, preserving the
name-value relations as results names. If an optional ``name`` argument is
given, a nested ``ParseResults`` will be returned.
c                 d     [        U 5        [        U [        5      (       + $ ! [         a     gf = f)NF)r   rF   r   	Exception)r   s    r   is_iterable+ParseResults.from_dict.<locals>.is_iterable  s4    5S	
 &c8444	  s   " 
//)rU   )rU   r]   )r   rF   r   	from_dict)rK   r   rU   r*  r   rg   rc   s          r   r,  ParseResults.from_dict  sx    	5 "gKKMDA!W%%}}Q}//sA3Q{1~>>	 "
 se$'C
r"   )r>   r?   r<   r=   rA   r@   )NNr   )r   r   r{   r   )r{   r   )rY   )rY   TTr   )@r1   r2   r3   r4   rN   r;   r	   r
   r6   rZ   r   boolr   r   r7   rG   rJ   rF   r    r&   ri   ry   r~   r5   r   r   r   r   r   r   rq   r   r   r   rf   r   r   r   r   r   r   r   r   r   r   r   r   rS   r   r   r   r  r  r  r*   r/   r!  r%  classmethodr,  r]   asDictgetNamer8   r   r"   r   r   r   "   s   +Z &*2rNL%S/2JCL3i38nI0%t 0%d0 d$:%"N> ,6 0" "" "8$ 8#( #)h )#.3% %6 p!.2#"*(
, M# M

 

	
 
(> >:*.`H HT78	

)3  4 F+F+G,r"   r   )collections.abcr   r   r   r   r   r   r  typingr	   r
   r   r   r   rZ   r   r   rI   r6   rR   r   r   registerr   r"   r   <module>r5     sy       . .!5\%c	
 )2' "w- w-t    %    &r"   