+
     hCd  c                   s   a  R	 t0 t ^ RIHtHtHtHtHtHt ^ RIt^ RI	H
t
HtHtHtHt ]]3t] ^ k ]! R R
 4       4      t ! R R4      t ! R R4      t]P,                  ! ]4       ]P,                  ! ]4       R# )    )MutableMappingMappingMutableSequenceIteratorSequence	ContainerN)TupleAnyDictSetListc              #   s$   "   T F  qx  K  	  R # 5iN ).0Z_   & 6/usr/lib/python3.14/site-packages/pyparsing/results.py	<genexpr>r      s     2a2s   c                   sV   a  ] tR t^t o R.tV 3R lR ltR tR tR tV 3R lt	Rt
V tR	# )
_ParseResultsWithOffsettupc                s$   < V ^8  d   QhRRRS[ /# )   p1ParseResultsp2intformat__classdict__   "r   __annotate__$_ParseResultsWithOffset.__annotate__   s     6 6> 6s 6    c                s    W3V n         R # r   r   )selfr   r      &&&r   __init__Z _ParseResultsWithOffset.__init__   s    .0Xr    c                s(    V P                   V,          # r   r!   r"   i   &&r   __getitem__Z#_ParseResultsWithOffset.__getitem__   s    xx{r    c                s    V P                   # r   r!   r"      &r   __getstate__Z$_ParseResultsWithOffset.__getstate__   s    xxr    c                s"    V^ ,          V n         R# r    Nr!   )r"   argss   &*r   __setstate__Z$_ParseResultsWithOffset.__setstate__   s    7r    c                s:   < V ^8  d   Qh/ S[ RS[3,          ;R&   # )r   r   r   )r   r   r   r   r   r   r      s     	~s"	## r    r!   N)__name__
__module____qualname____firstlineno__	__slots__r$   r(   r+   r.   __annotate_func____static_attributes____classdictcell__r      @r   r   r      s,     I6 6  r    r   c                   sN  a  ] tR t^"t o RtR. R@3tRAt ! R R]4      tRBR lt	RRRR]
3R ltR t]
3R	 ltR
 tV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltR tR tR tV 3R lR ltR tRCR ltR tR tR tR tR  tV 3R! lR" ltV 3R# lR$ lt V 3R% lR& lt!V 3R' lR( lt"V 3R) lR* lt#RDR+ lt$V 3R, lR- lt%V 3R. lR/ lt&V 3R0 lR1 lt'V 3R2 lR3 lt(R4 t)REV 3R5 lR6 llt*R7 t+R8 t,R9 t-R: t.R; t/]0RCV 3R< lR= ll4       t1]%t2 ]&t3 ])t4 V 3R> lt5R?t6V t7R# )Fr   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'
Nc                   s.   a  ] tR t^bt o RtRR ltRtV tR# )ParseResults.Lista  
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                s    Vf   . p\        V\        4      '       g.   \        V P                   R\	        V4      P                   24      h\        P                  V 4      # )Nz* may only be constructed with a list, not )
isinstancelist	TypeErrorr/   type__new__)clsZ	containedr'   r   r>   ZParseResults.List.__new__   sW     	i..||n$NtT]OgOgNhi  <<$$r    r   r   )r/   r0   r1   r2   __doc__r>   r5   r6   r7   r8   r   r   r9   b   s     $	L		% 		%r    r   c                s   \        V\        4      '       d   V# \        P                  V 4      pR Vn        R Vn        \        4       Vn        Vf	   . Vn        M_\        V\        \        34      '       d<   \        V\        P                  4      '       d   VR,          .M
\        V4      Vn        MV.Vn        \        4       Vn        V# )NNNN)r:   r   Zobjectr>   _name_parentset
_all_names_toklistr;   _generator_typer   dict_tokdict)r?   toklistnamekwargsr"   s   &&&, r   r>   ZParseResults.__new__   s    g|,,N~~c"
%?DM$!899 g|'8'899 '] M %IDMr    Tc                s>   V  W@n         Ve   VR8X  d   R # V! V\        4      '       d   \        V4      pV'       g	   V0V n        W n        WP
                  9   d   R # V! V\        \        34      '       d   V.pV'       dc   V! V\        4      '       d#   \        \        VP                  4      ^ 4      W&   M\        \        V^ ,          4      ^ 4      W&   W V,          n        R #  V^ ,          W&   R #   \        \        \        3 d    YJd   YT&    R # Y n         R # i ; i)N )_modalr   strrE   rB   _null_valuesstr_typer=   r   r   rF   KeyErrorr<   Z
IndexError)r"   rJ   rK   asListZmodalr:   s   &&&&&&r   r$   Z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   #C0 0DDDc                s0   \        V\        \        34      '       d   V P                  V,          # WP                  9  d"   V P
                  V,          R,          ^ ,          # \        V P
                  V,           Uu. uF  q"^ ,          NK  	  up4      # u upi )i   )r:   r   slicerF   rE   rI   r   )r"   r&   v   && r   r(   ZParseResults.__getitem__   sq    a#u&&==##OO#==#B'**4==+;<+;aqTT+;<==<s   ;Bc                s   V! V\         4      '       dD   V P                  P                  V\        4       4      V.,           V P                  V&   V^ ,          pMoV! V\        \
        34      '       d   W P                  V&   TpMEV P                  P                  V\        4       4      \        V^ 4      .,           V P                  V&   TpV! V\        4      '       d	   Wn        R# R# r,   )	r   rI   getr;   r   rU   rF   r   rC   )r"   krV   r:   Zsubs   &&&& r   __setitem__Z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           	     s   \        V\        \        34      '       g   V P                  V R # \	        V P
                  4      pV P
                  V \        V\        4      '       d"   V^ 8  d	   W,          p\        W^,           4      p\        \        VP                  V4      !  4      pVP                  4        V P                  P                  4        F9  pV F0  p\        V4       F  w  pw  rx\        WxW8  ,
          4      WF&   K   	  K2  	  K;  	  R # r   )r:   r   rU   rI   lenrF   r;   ZrangeZindicesZreversevalues	enumerater   )	r"   r&   ZmylenZremovedoccurrencesZjrY   valuepositions	   &&       r   __delitem__ZParseResults.__delitem__   s    !c5\**a DMM"MM! a1u
aQAuaii./0==//1K,5k,B(A(%<8<8&KN -C  2r    c                    < V ^8  d   QhRS[ /# r   returnboolr   r   r   r   ParseResults.__annotate__  s     " " "r    c                s    WP                   9   # r   rI   )r"   rY   r'   r   __contains__ZParseResults.__contains__  s    MM!!r    c                rb   rc   r   r   r   r   r   rg     s     " " "r    c                ,    \        V P                  4      # r   )r[   rF   r)   r*   r   __len__ZParseResults.__len__  s    4==!!r    c                rb   rc   re   r   r   r   r   rg     s     8 8$ 8r    c                sJ    V P                   ;'       g    V P                  '       # r   )rF   rI   r)   r*   r   __bool__ZParseResults.__bool__  s    6677r    c                rb   rc   r   r   r   r   r   rg     s     # #( #r    c                rj   r   iterrF   r)   r*   r   __iter__ZParseResults.__iter__      DMM""r    c                rb   rc   rm   r   r   r   r   rg     s     ) )h )r    c                s@    \        V P                  R R R1,          4      # )NrT   rn   r)   r*   r   __reversed__ZParseResults.__reversed__  s    DMM$B$'((r    c                rj   r   )ro   rI   r)   r*   r   keysZParseResults.keys  rq   r    c                8   a  V 3R  lS P                  4        4       # )c              3   s6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   rY   r"      & r   r   Z&ParseResults.values.<locals>.<genexpr>  s     -AQs   rs   r)      fr   r\   ZParseResults.values  s    ---r    c                rt   )c              3   s8   <"   T F  qSV,          3x  K  	  R # 5ir   r   ru   rv   r   r   Z%ParseResults.items.<locals>.<genexpr>  s     2kDGks   rw   r)   rx   r   itemsZParseResults.items  s    2diik22r    c                rb   rc   re   r   r   r   r   rg     s     % % %r    c                s"    V P                   '       # )z
Since ``keys()`` returns an iterator, this method is helpful in bypassing
code that looks for the existence of any defined results names.rh   r)   r*   r   haskeysZParseResults.haskeys  s     }}$$r    c                sB   V'       g   R.pVP                  4        F&  w  r4VR8X  d   V^ ,          V3pK  \        RV: 24      h	  \        V^ ,          \        4      '       g   \	        V4      ^8X  g   V^ ,          V 9   d   V^ ,          pW,          pW V# V^,          pV# )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']
Zdefaultz)pop() got an unexpected keyword argument rT   )ry   r<   r:   r   r[   )r"   r-   rL   rY   rV   indexretZdefaultvalues   &*,     r   popZParseResults.pop   s    P 4DLLNDAI~Q|"KA5 QRR	 #
 d1gs##s4yA~aDGE+CJ7Lr    c                s"    W9   d	   W,          # V# )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"   ZkeyZdefault_valuer#   r   rX   ZParseResults.getX  s    $ ;9  r    c                s    V P                   P                  W4       V P                  P                  4        F0  p\	        V4       F  w  pw  rV\        WVWa8  ,           4      W4&   K   	  K2  	  R# )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)rF   insertrI   r\   r]   r   )r"   r{   Z
ins_stringr^   rY   r_   r`      &&&    r   r~   ZParseResults.inserto  s[    " 	U/==//1K(1+(>$$E!8x'78" )? 2r    c                s<    V P                   P                  V4       R# )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)rF   append)r"   itemr'   r   r   ZParseResults.append  s     	T"r    c                s    \        V\        4      '       d   V P                  V4       R# V P                  P	                  V4       R# )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)r:   r   __iadd__rF   extend)r"   Zitemseqr'   r   r   ZParseResults.extend  s/     g|,,MM'"MM  )r    c                sT    V P                   R V P                  P                  4        R# )z'
Clear all elements and results names.
rA   N)rF   rI   clearr)   r*   r   r   ZParseResults.clear  s      MM!r    c                s|     W,          #   \          d'    TP                  R 4      '       d   \        T4      h R# i ; i)Z__rM   )rR   Z
startswithZAttributeError)r"   rK   r'   r   __getattr__ZParseResults.__getattr__  s;    	: 	t$$$T**	s   
 !;;;c                "   < V ^8  d   QhRRRR/# r   otherr   rd   r   r   r   r   r   rg     s      ^  r    c                s6    V P                  4       pW!,          pV# r   )copy)r"   r   r|   rW   r   __add__ZParseResults.__add__  s    iik
r    c                r   r   r   r   r   r   r   rg     s      n  r    c                s:  a V'       g   V # VP                   '       d   \        V P                  4      oV3R  lpVP                   P                  4       pV UUUu. uF0  w  rEV F%  pV\	        V^ ,          V! V^,          4      4      3NK'  	  K2  	  ppppV F5  w  rFW`V&   \        V^ ,          \        4      '       g   K(  W^ ,          n        K7  	  V ;P                  VP                  ,          un        V ;P                  VP                  ,          un        V # u upppi )c                 s(   < V ^ 8  d   S# V S,           # r    r   )Zaoffsets   &r   Z<lambda>Z'ParseResults.__iadd__.<locals>.<lambda>  s    AE&"Aq6z"Ar    )	rI   r[   rF   ry   r   r:   r   rC   rE   )	r"   r   Z	addoffsetZ
otheritemsrY   vlistrV   Zotherdictitemsr   s	   &&      @r   r   ZParseResults.__iadd__  s    K>>>'FAI--/J !+ *HAA +AaD)AaD/BC D *  
 'QadL11#'aDL '
 	'5+++s   6Dc                   < V ^8  d   QhRR/# r   rd   r   r   r   r   r   r   rg     s          r    c                sl    \        V\        4      '       d   V^ 8X  d   V P                  4       # W,           # r   )r:   r   r   )r"   r   r'   r   __radd__ZParseResults.__radd__  s+    eS!!eqj99; <r    c                rb   rc   rO   r   r   r   r   rg     s     M M# Mr    c                sp    \        V 4      P                   R V P                  : RV P                  4        R2# )Z(, Z))r=   r/   rF   as_dictr)   r*   r   __repr__ZParseResults.__repr__  s2    t*%%&a'84<<>:J!LLr    c                rb   rc   r   r   r   r   r   rg     s     

 

 

r    c           
     s    R RP                  V P                   Uu. uF/  p\        V\        4      '       d   \	        V4      M
\        V4      NK1  	  up4      ,           R,           # u upi )[r   Z])joinrF   r:   r   rO   reprr%   r   r   __str__ZParseResults.__str__  sd    ii "]]* )L99CFtAwF* 		
s   5A$
c                s   . pV P                    Fl  pV'       d   V'       d   VP                  V4       \        V\        4      '       d   W#P	                  4       ,          pKR  VP                  \        V4      4       Kn  	  V# r   )rF   r   r:   r   _asStringListrO   )r"   Zsepoutr      &&  r   r   ZParseResults._asStringList  sZ    MMDs

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

3t9% " 
r    c                rb   rc   )r;   r   r   r   r   rg     s     
 
 
r    c                s    V P                    Uu. uF+  p\        V\        4      '       d   VP                  4       MTNK-  	  up# u upi )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']
)rF   r:   r   as_list)r"   Zresr   r   r   ZParseResults.as_list  sD    " }}
$ (\::CKKMC$
 	
 
s   1Ac                rb   rc   )rH   r   r   r   r   rg     s     > > >r    c                sV   a V3R lo\        V3R lV P                  4        4       4      # )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                 s   < \        V \        4      '       d?   V P                  4       '       d   V P                  4       # V  Uu. uF  pS! V4      NK  	  up# V # u upi r   )r:   r   rz   r   )objrV   to_itemrv   r   r   Z%ParseResults.as_dict.<locals>.to_item"  sL    #|,,(+s{{}TPS;TPS1GAJPS;TT
 <Us   Ac              3   s<   <"   T F  w  rVS! V4      3x  K  	  R # 5ir   r   )r   rY   rV   r   s   &  r   r   Z'ParseResults.as_dict.<locals>.<genexpr>(  s     =Q
Os   )rH   ry   )r"   r   s   &@r   r   ZParseResults.as_dict  s!    *	 =

===r    c                r   r   r   r   r   r   r   rg   *  s      n r    c                s    \        V P                  4      pV P                  P                  4       Vn        V P                  Vn        V;P
                  V P
                  ,          un        V P                  Vn        V# )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   rF   rI   r   rC   rE   rB   )r"   r|   r   r   r   ZParseResults.copy*  sS     4==)}}))+ll$//)JJ	
r    c                r   r   r   r   r   r   r   rg   8  s      . r    c                sz   V P                  4       p\        V P                  4       EF  w  r#\        V\        4      '       d    VP                  4       V P                  V&   K;  \        V\        \        34      '       d   KY  \        V\        4      '       de   \        V4      ! 4       ;V P                  V&   pVP                  4        F/  w  rV\        V\        4      '       d   VP                  4       MTWE&   K1  	  K  \        V\        4      '       g   K  \        V4      ! R V 4       4      V P                  V&   EK  	  V# )z<
Returns a new deep copy of a :class:`ParseResults` object.
c              3   sr   "   T F-  p\        V\        4      '       d   VP                  4       MTx  K/  	  R # 5ir   )r:   r   deepcopy)r   rV   r   r   r   Z(ParseResults.deepcopy.<locals>.<genexpr>H  s+      -PS1Jq,$?$?AJJLQFPSs   57)r   r]   rF   r:   r   r   rO   bytesr   r=   ry   r   )r"   r|   r&   r   ZdestrY   rV   s   &      r   r   Z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                s
  a  S P                   '       d   S P                   # S P                  '       d=   S P                  pVP                  P                  4       p\	        V 3R lV 4       R4      # \        S 4      ^8X  d   \        S P                  4      ^8X  dl   \	        \        S P                  P                  4       4      4      ^ ,          ^,          R9   d-   \	        \        S P                  P                  4       4      4      # R# )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   sR   <"   T F  w  rV F  w  r4VSJ g   K  Vx  K  	  K  	  R # 5ir   r   )r   rY   r   rV   Zlocr"   s   &    r   r   Z(ParseResults.get_name.<locals>.<genexpr>l  s2      $8"'Dy A"' $8s   ''N)r    rT   )	rB   rC   rI   ry   Znextr[   ro   r\   rs   )r"   parZparent_tokdict_itemss   f  r   get_nameZ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                rb   rc   r   r   r   r   r   rg   }  s     H H Hr    c                s   . pRpTP                  V'       d!   V\        V P                  4       4      ,           MR4       V'       g   RP                  V4      # V P	                  4       '       d   \        R V P                  4        4       4      pV F  w  rV'       d   VP                  V4       VP                  V RV,           RV R24       \        V	\        4      '       g   VP                  \        V	4      4       Kp  V	'       g   VP                  \        V	4      4       K  VP                  V	P                  VVVV^,           R7      4       K  	  \        ;QJ d    R V  4       F  '       g   K   R	M	  R
M! R V  4       4      '       g   RP                  V4      # T p	Rp
Rp\        V	4       F  w  r\        V\        4      '       dU   VP                  VVVV^,           R7      pVP                  V V W,           RV RV V W^,           ,           V 2
4       Ko  VP                  V V W,           RV RV V W^,           ,           V 2
4       K  	  RP                  V4      # )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'
Z
rM   c              3   s@   "   T F  w  r\        V4      V3x  K  	  R # 5ir   r   )r   rY   rV   s   &  r   r   $ParseResults.dump.<locals>.<genexpr>  s     @<41CFA;<s   z  z- z: )indentfullinclude_list_depthc              3   sB   "   T F  p\        V\        4      x  K  	  R # 5ir   )r:   r   )r   vvr   r   r   r     s     ?$B:b,//$s   TFr   z]:)r   rO   r   r   rz   Zsortedry   r:   r   r   dumpZanyr]   )r"   r   r   r   r   r   ZNLry   rY   rV   ZincrZnlr&   r   Zvv_dumps   &&&&&          r   r   ZParseResults.dump}  s   * 

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

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

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

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

d6(4=/1#RtF8DUVJDWCXY[X\] "  wws|r    c                sV    \         P                   ! V P                  4       .VO5/ VB  R# )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-   rL   s   &*,r   r   ZParseResults.pprint  s     2 	dlln6t6v6r    c                s~    V P                   V P                  P                  4       R V P                  V P                  33# r   )rF   rI   r   rE   rB   r)   r*   r   r+   ZParseResults.__getstate__  s9    MM""$

	
 	
r    c                sd    Vw  V n         w  V n        r#V n        \        V4      V n        R V n        R # r   )rF   rI   rB   rD   rE   rC   )r"   Zstater   ZinAccumNamesr   r   r.   ZParseResults.__setstate__  s,    HMEEs$*l+r    c                s2    V P                   V P                  3# r   )rF   rB   r)   r*   r   __getnewargs__ZParseResults.__getnewargs__  s    }}djj((r    c                sf    \        \        V 4      4      \        V P                  4       4      ,           # r   )Zdirr=   r;   rs   r)   r*   r   __dir__ZParseResults.__dir__  s     4:diik!222r    c                r   r   r   r   r   r   r   rg     s      N r    c           	     s    R pV ! . 4      pVP                  4        FL  w  rV\        V\        4      '       d   W@P                  WeR7      ,          pK5  W@! V.WS! V4      R7      ,          pKN  	  Ve   V ! V.VR7      pV# )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                 sh     \        V 4       \        V \        4      '       * #   \         d     R # i ; i)F)ro   r:   rQ   Z	Exception)r   r*   r   is_iterableZ+ParseResults.from_dict.<locals>.is_iterable  s4    5S	
 &c8444	  s   " 11)rK   )rK   rS   )ry   r:   r   	from_dict)r?   r   rK   r   r|   rY   rV   r   r   r   ZParseResults.from_dict  sx    	5 "gKKMDA!W%%}}Q}//sA3Q{1~>>	 "
 se$'C
r    c                s   < V ^8  d   Qh/ S[ S[R3,          ;R&   S[;R&   R;R&   S[S[,          ;R&   S[;R&   S[S[,          ;R&   S[S[S[3,          ;R	&   # )
r   .rP   rB   r   rC   rE   rN   rF   rI   )r   r   rO   r
   rf   r   r	   r   r   r   r   rg   "   s     \ S/2] ` Ja b c d Ce f Lg h 3ii j 38nk r    )rE   rN   rB   rC   rI   rF   r   )rB   rC   rE   rN   rF   rI   )NNr   )rM   )rM   TTr    )8r/   r0   r1   r2   r@   rP   r3   r;   r   r>   r:   r$   r(   rZ   ra   ri   rk   rl   rp   rr   rs   r\   ry   rz   r}   rX   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r+   r.   r   r   Zclassmethodr   rS   ZasDictZgetNamer4   r5   r6   r7   r8   r   r   r   "   s    +Z &*2rNLI0%t 0%d0 d$:%"N> ,6 0" "" "8 8# #) )#.3% %6 p!.2#"*( 
 ,   M M

 

	
 
(> >:  *.`H HT78	

)3   4 F+F+G,o  r    r   c                sZ    V ^8  d   Qh/ ^ \         9   d   \        \        R3,          ;R&   # )r   .rQ   )__conditional_annotations__r   r=   )r   s   "r   r   r      s'       * )%c	
 )r    r   )r   Zcollections.abcr   r   r   r   r   r   r   Ztypingr   r   r	   r
   r   rO   r   rQ   r=   rG   r   r   Zregisterr   )r   r8   r   <module>r      so       . .!5\ )2' "w- w-t    %    &r    