+
    TBil                       a  0 t $ ^ RIHt ^ RIt^ RIHtHtHtHtH	t	 ^ RI
t
^ RIHt ^RIHt ]]3tR]R&   ]! R R 4       4      t ! R	 R
4      t ! R R4      t]P.                  ! ]4       ]P.                  ! ]4       R# )    )annotationsN)MutableMappingMappingMutableSequenceIteratorIterable)Any)replaced_by_pep8ztuple[type, ...]str_typec              #  $   "   T F  qx  K  	  R # 5iN ).0_s   & 6/usr/lib/python3.14/site-packages/pyparsing/results.py	<genexpr>r      s     2a2s   c                  F    ] tR t^t$ R]R&   R.tR R ltR tR tR t	Rt
R	# )
_ParseResultsWithOffsetztuple[ParseResults, int]tupc               $    V ^8  d   QhRRRRRR/# )   p1ParseResultsp2intreturnNoner   )formats   "r   __annotate__$_ParseResultsWithOffset.__annotate__   s!     6 6< 6S 6T 6    c                	    W3V n         R # r   r   )selfr   r   s   &&&r   __init__ _ParseResultsWithOffset.__init__   s    .0Xr!   c                	(    V P                   V,          # r   r#   r$   is   &&r   __getitem__#_ParseResultsWithOffset.__getitem__   s    xx{r!   c                	    V P                   # r   r#   r$   s   &r   __getstate__$_ParseResultsWithOffset.__getstate__!   s    xxr!   c                	"    V^ ,          V n         R# r   Nr#   )r$   argss   &*r   __setstate__$_ParseResultsWithOffset.__setstate__$   s    7r!   r#   N)__name__
__module____qualname____firstlineno____annotations__	__slots__r%   r*   r.   r3   __static_attributes__r   r!   r   r   r      s#    	!!I6r!   r   c                  ,   ] tR t^(t$ RtR. RP3tR]R&   R]R&   R ]R&   R]R	&   R
]R&   R]R&   R]R&   RQt ! R R]4      t	RRR lt
RRRR]3R R lltR t]3R ltR tR R ltR R ltR R ltR R  ltR! R" ltR# tR$ tR% tR& R' ltR( tRSR) ltR* tR+ tR, tR- tR. tR/ R0 lt R1 R2 lt!R3 R4 lt"R5 R6 lt#R7 R8 lt$RTR9 lt%R:R;/R< R= llt&R> R? lt'R@ RA lt(RB RC lt)RD RE lt*RURF RG llt+RH t,RI t-RJ t.RK t/RL t0]1RSRM RN ll4       t2]&t3 ]'t4 ]*t5ROt6R# )Vr   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:

.. testcode::

   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:

.. testoutput::

   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'

Nztuple[Any, ...]_null_valuesstr_name_parentzset[str]
_all_namesbool_modalz	list[Any]_toklistzdict[str, Any]_tokdictc                  $    ] tR t^ntRtRR ltR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`:

.. testcode::

   import pyparsing as pp
   ppc = pp.common

   LBRACK, RBRACK, LPAR, RPAR = pp.Suppress.using_each("[]()")
   element = pp.Forward()
   item = ppc.integer
   item_list = pp.DelimitedList(element)
   element_list = LBRACK + item_list + RBRACK | LPAR + item_list + RPAR
   element <<= item | element_list

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

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

prints:

.. testoutput::
   :options: +NORMALIZE_WHITESPACE


   100
   (100, <class 'int'>)

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

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

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

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

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

(Used internally by :class:`Group` when `aslist=True`.)
Nc                	    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	TypeErrorr5   type__new__)cls	containeds   &&r   rM   ParseResults.List.__new__   sW     	i..||n$NtT]OgOgNhi  <<$$r!   r   r   )r5   r6   r7   r8   __doc__rM   r;   r   r!   r   ListrG   n   s    9	v		% 		%r!   rR   c                	   \        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)rI   r   objectrM   r?   r@   setrA   rD   rJ   _generator_typerR   dictrE   )rN   toklistnamekwargsr$   s   &&&, r   rM   ParseResults.__new__   s    g|,,N~~c"
%?DM$!899 g|'8'899 '] M %IDMr!   Tc                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   ParseResults.__annotate__   s     %" %"	%"r!   c                	>   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 )rC   r   r>   rA   r?   r=   r   rL   r   r   rD   KeyErrorrK   
IndexError)r$   rY   rZ   asListmodalrI   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   #C0 0DDDc                	0   \        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 )   )rI   r   slicerD   rA   rE   r   )r$   r)   vs   && r   r*   ParseResults.__getitem__   sq    a#u&&==##OO#==#B'**4==+;<+;aqTT+;<==<s   ;Bc                	   V! V\         4      '       dD   V P                  P                  V\        4       4      V.,           V P                  V&   V^ ,          pMgV! V\        \
        34      '       d   W P                  V&   TpM=V P                  P                  V. 4      \        V^ 4      .,           V P                  V&   TpV! V\        4      '       d	   Wn        R# R# r1   )	r   rE   getrJ   r   ri   rD   r   r@   )r$   krj   rI   subs   &&&& r   __setitem__ParseResults.__setitem__   s    a011#}}00DF;qcADMM!A$CC<(( MM!C#}}00B7'1-;  DMM! Cc<((K )r!   c           	     	   \        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   )rI   r   ri   rE   lenrD   rJ   rangeindicesreversevalues	enumerater   )	r$   r)   mylenremovedoccurrencesjrn   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!   c                   V ^8  d   QhRR/# r   r   rB   r   )r   s   "r   r   r^   #  s     " " "r!   c                	    WP                   9   # r   rE   )r$   rn   s   &&r   __contains__ParseResults.__contains__#  s    MM!!r!   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r^   &  s     " " "r!   c                	,    \        V P                  4      # r   )rs   rD   r-   s   &r   __len__ParseResults.__len__&  s    4==!!r!   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r^   )  s     8 8$ 8r!   c                	J    V P                   ;'       g    V P                  '       # r   )rD   rE   r-   s   &r   __bool__ParseResults.__bool__)  s    6677r!   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   r^   ,  s     # #( #r!   c                	,    \        V P                  4      # r   iterrD   r-   s   &r   __iter__ParseResults.__iter__,      DMM""r!   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r^   /  s     ) )h )r!   c                	@    \        V P                  R R R1,          4      # Nrh   r   r-   s   &r   __reversed__ParseResults.__reversed__/  s    DMM$B$'((r!   c                	,    \        V P                  4      # r   )r   rE   r-   s   &r   keysParseResults.keys2  r   r!   c                	8   a  V 3R  lS P                  4        4       # )c              3  6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   rn   r$   s   & r   r   &ParseResults.values.<locals>.<genexpr>6  s     -AQs   r   r-   s   fr   rw   ParseResults.values5  s    ---r!   c                	8   a  V 3R  lS P                  4        4       # )c              3  8   <"   T F  qSV,          3x  K  	  R # 5ir   r   r   s   & r   r   %ParseResults.items.<locals>.<genexpr>9  s     2kDGks   r   r-   s   fr   itemsParseResults.items8  s    2diik22r!   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r^   ;  s     % % %r!   c                "    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.r   r-   s   &r   haskeysParseResults.haskeys;  s     }}$$r!   c                B   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# )af  
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:

.. doctest::

   >>> 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)
   [W:(0-9)]...
   >>> 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())
   ['AAB', '123', '321']
   - LABEL: 'AAB'

   >>> # 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)
   {W:(A-Za-z) {W:(0-9)}...}
   >>> print(patt.parse_string("AAB 123 321").dump())
   ['AAB', '123', '321']

defaultz)pop() got an unexpected keyword argument rh   )r   rK   rI   r   rs   )r$   r2   r[   rn   rj   indexretdefaultvalues   &*,     r   popParseResults.popA  s    \ 4DLLNDAI~Q|"KA5 QRR	 #
 d1gs##s4yA~aDGE+CJ7Lr!   c                "    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:

.. doctest::

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

   >>> result = date_str.parse_string("1999/12/31")
   >>> result.get("year")
   '1999'
   >>> result.get("hour", "not specified")
   'not specified'
   >>> result.get("hour")

r   )r$   keydefault_values   &&&r   rm   ParseResults.get  s    . ;9  r!   c                    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:

.. doctest::

   >>> 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)
   [W:(0-9)]...
   >>> print(numlist.parse_string("0 123 321"))
   [0, '0', '123', '321']

N)rD   insertrE   rw   rx   r   )r$   r   
ins_stringr{   rn   r}   r~   s   &&&    r   r   ParseResults.insert  s[    2 	U/==//1K(1+(>$$E!8x'78" )? 2r!   c                <    V P                   P                  V4       R# )a  
Add single element to end of ``ParseResults`` list of elements.

Example:

.. doctest::

   >>> 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)
   [W:(0-9)]...
   >>> print(numlist.parse_string("0 123 321"))
   ['0', '123', '321', 444]
N)rD   append)r$   items   &&r   r   ParseResults.append  s    , 	T"r!   c                    \        V\        4      '       d   V P                  V4       R# V P                  P	                  V4       R# )a  
Add sequence of elements to end of :class:`ParseResults` list of elements.

Example:

.. testcode::

   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"))

prints:

.. testoutput::

   ['lskdjsdlkjflksddsklfjkldsjdksl']
N)rI   r   __iadd__rD   extend)r$   itemseqs   &&r   r   ParseResults.extend  s/    2 g|,,MM'"MM  )r!   c                T    V P                   R V P                  P                  4        R# )z'
Clear all elements and results names.
rT   N)rD   rE   clearr-   s   &r   r   ParseResults.clear  s      MM!r!   c                	|     W,          #   \          d'    TP                  R 4      '       d   \        T4      h R# i ; i)__r`   )ra   
startswithAttributeError)r$   rZ   s   &&r   __getattr__ParseResults.__getattr__  s;    	: 	t$$$T**	s   
 !;;;c                    V ^8  d   QhRRRR/# r   otherr   r   r   )r   s   "r   r   r^     s      \ l r!   c                	6    V P                  4       pW!,          pV# r   )copy)r$   r   r   s   && r   __add__ParseResults.__add__  s    iik
r!   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r^     s      l | r!   c                	:  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                (   < V ^ 8  d   S# V S,           # r   r   )aoffsets   &r   <lambda>'ParseResults.__iadd__.<locals>.<lambda>  s    AE&"Aq6z"Ar!   )	rE   rs   rD   r   r   rI   r   r@   rA   )	r$   r   	addoffset
otheritemsrn   vlistrj   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   6Dc                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   r^     s          r!   c                	l    \        V\        4      '       d   V^ 8X  d   V P                  4       # W,           # r   )rI   r   r   )r$   r   s   &&r   __radd__ParseResults.__radd__  s+    eS!!eqj99; <r!   c                   V ^8  d   QhRR/# r   r   r>   r   )r   s   "r   r   r^   $  s     M M# Mr!   c                	p    \        V 4      P                   R V P                  : RV P                  4        R2# )(, ))rL   r5   rD   as_dictr-   s   &r   __repr__ParseResults.__repr__$  s2    t*%%&a'84<<>:J!LLr!   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r^   '  s     

 

 

r!   c           
     	    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   ])joinrD   rI   r   r>   reprr(   s   & r   __str__ParseResults.__str__'  sd    ii "]]* )L99CFtAwF* 		
s   5A$
c                	   . 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   )rD   r   rI   r   _asStringListr>   )r$   sepoutr   s   &&  r   r   ParseResults._asStringList3  sZ    MMDs

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

3t9% " 
r!   flattenFc                    V ^8  d   QhRRRR/# )r   r   rB   r   rJ   r   )r   s   "r   r   r^   >  s     . .$ .4 .r!   c                  a  V 3R lpV'       d   . V! S 4      O# S 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.
If ``flatten`` is True, all the nesting levels in the returned list are collapsed.

Example:

.. doctest::

   >>> 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
   >>> type(result)
   <class 'pyparsing.results.ParseResults'>
   >>> print(result)
   ['sldkj', 'lsdkj', 'sldkj']

.. doctest::

   >>> # Use as_list() to create an actual list
   >>> result_list = result.as_list()
   >>> type(result_list)
   <class 'list'>
   >>> print(result_list)
   ['sldkj', 'lsdkj', 'sldkj']

.. versionchanged:: 3.2.0
   New ``flatten`` argument.
c              3     <"   \         P                  ! . SO4      pV'       dJ   VP                  4       p\        V\        4      '       d   VP                  VR R R1,          4       KK  Vx  KQ  R # 5ir   )collectionsdequepopleftrI   r   
extendleft)prto_visitto_dor$   s   &  r   	flattened'ParseResults.as_list.<locals>.flattened]  sX     "((41H ((*e\22''dd4K s    A/AA/)rD   rI   r   as_list)r$   r   r	  ress   f$  r   r  ParseResults.as_list>  s^    >	  %Yt_%%  ==(C ",C!>!>CG(  s   1Ac                   V ^8  d   QhRR/# )r   r   rX   r   )r   s   "r   r   r^   n  s     '> '> '>r!   c                V   a V3R lo\        V3R lV P                  4        4       4      # )a  
Returns the named parse results as a nested dictionary.

Example:

.. doctest::

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

   >>> result = date_str.parse_string('1999/12/31')
   >>> type(result)
   <class 'pyparsing.results.ParseResults'>
   >>> result
   ParseResults(['1999', '/', '12', '/', '31'], {'year': '1999', 'month': '12', 'day': '31'})

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

   >>> # even though a ParseResults supports dict-like access,
   >>> # sometime you just need to have a dict
   >>> import json
   >>> print(json.dumps(result))
   Traceback (most recent call last):
   TypeError: Object of type ParseResults is not JSON serializable
   >>> print(json.dumps(result.as_dict()))
   {"year": "1999", "month": "12", "day": "31"}
c                   < \        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   )rI   r   r   r   )objrj   to_items   & r   r  %ParseResults.as_dict.<locals>.to_item  sL    #|,,(+s{{}TPS;TPS1GAJPS;TT
 <Us   Ac              3  <   <"   T F  w  rVS! V4      3x  K  	  R # 5ir   r   )r   rn   rj   r  s   &  r   r   'ParseResults.as_dict.<locals>.<genexpr>  s     =Q
Os   )rX   r   )r$   r  s   &@r   r   ParseResults.as_dictn  s"    B	 =

===r!   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r^     s      l r!   c                    \        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.
:class:`ParseResults` items contained within the source are
shared with the copy. Use :meth:`ParseResults.deepcopy` to
create a copy with its own separate content values.
)r   rD   rE   r   r@   rA   r?   )r$   r   s   & r   r   ParseResults.copy  sS     4==)}}))+ll$//)JJ	
r!   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r^     s      , r!   c                z   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# )zU
Returns a new deep copy of a :class:`ParseResults` object.

.. versionadded:: 3.1.0
c              3  r   "   T F-  p\        V\        4      '       d   VP                  4       MTx  K/  	  R # 5ir   )rI   r   deepcopy)r   rj   s   & r   r   (ParseResults.deepcopy.<locals>.<genexpr>  s+      ,PS1Jq,$?$?AJJLQFPSs   57)r   rx   rD   rI   r   r  r>   bytesr   rL   r   r   )r$   r   r)   r  destrn   rj   s   &      r   r  ParseResults.deepcopy  s     iik.FA#|,,"%,,.QC#u..C00)-c4Q$IIKDA.8L.I.IajjlqDG (C**"&s) ,PS, #Q / 
r!   c                   V ^8  d   QhRR/# )r   r   z
str | Noner   )r   s   "r   r   r^     s     5 5* 5r!   c                
  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:

.. testcode::

   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:

.. testoutput::

   age : 22
   ssn : 111-22-3333
   house_number : 221B

c              3  R   <"   T F  w  rV F  w  r4VSJ g   K  Vx  K  	  K  	  R # 5ir   r   )r   rn   r   rj   locr$   s   &    r   r   (ParseResults.get_name.<locals>.<genexpr>  s2      $8"'Dy A"' $8s   ''N)r   rh   )	r?   r@   rE   r   nextrs   r   rw   r   )r$   parparent_tokdict_itemss   f  r   get_nameParseResults.get_name  s    @ :::::\\\ $C#&<<#5#5#7 $8   INDMM"a'T$--..01215a8GCT]]//1233r!   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r^     s     L L Lr!   c                   . 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:

.. testcode::

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

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

prints:

.. testoutput::

   ['1999', '/', '12', '/', '31']
   - day: '31'
   - month: '12'
   - year: '1999'

r`   c              3  @   "   T F  w  r\        V4      V3x  K  	  R # 5ir   )r>   )r   rn   rj   s   &  r   r   $ParseResults.dump.<locals>.<genexpr>  s     @<41CFA;<s   z  z- z: )indentfullinclude_list_depthc              3  B   "   T F  p\        V\        4      x  K  	  R # 5ir   )rI   r   )r   vvs   & r   r   r0  )  s     ?$B:b,//$s   TFr   z]:)r   r>   r  r   r   sortedr   rI   r   r   dumpanyrx   )r$   r1  r2  r3  r4  r   NLr   rn   rj   incrnlr)   r6  vv_dumps   &&&&&          r   r8  ParseResults.dump  s   2 

<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                V    \         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:

.. testcode::

   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:

.. testoutput::

   ['fna',
    ['a',
     'b',
     ['(', 'fnb', ['c', 'd', '200'], ')'],
     '100']]
N)pprintr  )r$   r2   r[   s   &*,r   r@  ParseResults.pprintA  s     : 	dlln6t6v6r!   c                	~    V P                   V P                  P                  4       R V P                  V P                  33# r   )rD   rE   r   rA   r?   r-   s   &r   r.   ParseResults.__getstate__a  s9    MM""$

	
 	
r!   c                	d    Vw  V n         w  V n        r#V n        \        V4      V n        R V n        R # r   )rD   rE   r?   rV   rA   r@   )r$   stater(  inAccumNamess   &&  r   r3   ParseResults.__setstate__l  s,    HMEEs$*l+r!   c                	2    V P                   V P                  3# r   )rD   r?   r-   s   &r   __getnewargs__ParseResults.__getnewargs__q  s    }}djj((r!   c                	f    \        \        V 4      4      \        V P                  4       4      ,           # r   )dirrL   rJ   r   r-   s   &r   __dir__ParseResults.__dir__t  s     4:diik!222r!   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r^   x  s      L r!   c           	         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 :class:`ParseResults` from a ``dict``, preserving the
name-value relations as results names. If an optional ``name`` argument is
given, a nested :class:`ParseResults` will be returned.
c                h     \        V 4       \        V \        4      '       * #   \         d     R # i ; i)F)r   rI   r   	Exception)r  s   &r   is_iterable+ParseResults.from_dict.<locals>.is_iterable  s4    5S	
 &c8444	  s   " 11)rZ   )rZ   rc   )r   rI   r   	from_dict)rN   r   rZ   rS  r   rn   rj   s   &&&    r   rU  ParseResults.from_dictw  sx    	5 "gKKMDA!W%%}}Q}//sA3Q{1~>>	 "
 se$'C
r!   )rA   rC   r?   r@   rE   rD   r   )r?   r@   rA   rC   rD   rE   )NNr   )r`   )r`   TTr   )7r5   r6   r7   r8   rQ   r=   r9   r:   rJ   rR   rM   rI   r%   r*   rp   r   r   r   r   r   r   r   rw   r   r   r   rm   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r  r*  r8  r@  r.   r3   rI  rM  classmethodrU  rc   asDictgetNamer;   r   r!   r   r   r   (   sk   1f &*2rNL/2JLIE%t E%N0 d$:%"N> ,6 0""8#)#.3%< |!8B#0*<
, M

	. .`'>R.5nL\7@	

)3  4 F F Gr!   r   r   )__conditional_annotations__
__future__r   r  collections.abcr   r   r   r   r   r@  typingr	   utilr
   r>   r  r   r9   rL   rW   r   r   register)rZ  s   @r   <module>r`     sz    # "     " "5\
 )2' "x xv    %    &r!   