HOME


Mini Shell 1.0
DIR: /snap/certbot/4482/lib/python3.12/site-packages/pyparsing/__pycache__/
Upload File :
Current File : //snap/certbot/4482/lib/python3.12/site-packages/pyparsing/__pycache__/results.cpython-312.pyc
�

�S�g�f���UddlmZddlZddlmZmZmZmZmZddl	Z	ddl
mZddlm
Z
eefZded<ed	�d
D��ZGd�d�ZGd
�d�Zej,e�ej,e�y)�)�annotationsN)�MutableMapping�Mapping�MutableSequence�Iterator�Iterable)�Any�)�replaced_by_pep8ztuple[type, ...]�str_typec#� K�|]}|���y�w�N�)�.0�_s  ��/build/snapcraft-certbot-29b1212f749eeba2f1dece1adfe9a83a/parts/certbot/install/lib/python3.12/site-packages/pyparsing/results.py�	<genexpr>rs�����a���s�rc�8�eZdZUded<dgZdd�Zd�Zd�Zd�Zy)	�_ParseResultsWithOffsetztuple[ParseResults, int]�tupc��||f|_yr�r)�self�p1�p2s   r�__init__z _ParseResultsWithOffset.__init__s
��.0�"�X���c� �|j|Srr�r�is  r�__getitem__z#_ParseResultsWithOffset.__getitem__s���x�x��{�rc��|jSrr�rs r�__getstate__z$_ParseResultsWithOffset.__getstate__ s���x�x�rc��|d|_y�Nrr)r�argss  r�__setstate__z$_ParseResultsWithOffset.__setstate__#s
����7��rN)r�ParseResultsr�int)	�__name__�
__module__�__qualname__�__annotations__�	__slots__rr!r$r(rrrrrs#��	!�!���I�6���rrc���eZdZUdZdgdfZded<ded<ded<d	ed
<ded<d
ed<ded<dZGd�de�Zd>d�Z	dddde
f	d?d�Zd�Ze
fd�Z
d�Zd@d�ZdAd�Zd@d�ZdBd�ZdBd�Zd�Zd �Zd!�Zd@d"�Zd#�ZdCd$�Zd%�Zd&�Zd'�Zd(�Zd)�ZdDd*�ZdDd+�Z dEd,�Z!dFd-�Z"dFd.�Z#dGd/�Z$d0d1�dHd2�Z%dId3�Z&dEd4�Z'dEd5�Z(dJd6�Z)dKdFd7�Z*d8�Z+d9�Z,d:�Z-d;�Z.d<�Z/e0dCdEd=��Z1e%Z2	e&Z3	e)Z4y)Lr)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'
    Nrztuple[Any, ...]�_null_values�str�_name�_parentzset[str]�
_all_names�bool�_modalz	list[Any]�_toklistzdict[str, Any]�_tokdict)r3r4r5r7r8r9c��eZdZdZdd�Zy)�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��|�g}t|t�s-t|j�dt	|�j����tj|�S)Nz* may only be constructed with a list, not )�
isinstance�list�	TypeErrorr+�type�__new__)�cls�	containeds  rrAzParseResults.List.__new__�sT��� ��	��i��.���|�|�n�$N�t�T]��Og�Og�Nh�i����<�<��$�$rr)r+r,r-�__doc__rArrr�Listr;gs
��$	�L		%rrEc�^�t|t�r|Stj|�}d|_d|_t
�|_|�g|_nOt|ttf�r1t|tj�r|ddgn
t|�|_n|g|_t�|_
|Sr)r=r)�objectrAr3r4�setr5r8r>�_generator_typerE�dictr9)rB�toklist�name�kwargsrs     rrAzParseResults.__new__�s����g�|�,��N��~�~�c�"����
�����%����?��D�M�
��$��!8�
9��g�|�'8�'8�9������'�]�
�M�%�I�D�M����
��rTc���|||_|�|dk(ry||t�rt|�}|s|h|_||_||j
vry||ttf�r|g}|rV||t�r#tt|j�d�||<ntt|d�d�||<|||_y	|d||<y#tttf$r||ur|||<Yy||_YywxYw)N�r)r7r*r2r5r3r1rr@r)rr8�KeyErrorr?�
IndexError)rrKrL�asList�modalr=s      rrzParseResults.__init__�s���	
�����<�4�2�:���d�C� ��t�9�D��#�f�D�O���
��d�'�'�'���g��$�/�0��i�G���'�<�0�4�\�'�BR�BR�5S�UV�W��T�
�4�\�'�!�*�5M�q�Q��T�
�#�D��J���	"� ���D��J���)�Z�0�	"��d�"�$��T�
�!��
�		"�s�9C�C+�!C+�*C+c���t|ttf�r|j|S||jvr|j
|ddSt
|j
|D�cgc]}|d��	c}�Scc}w)N���r)r=r*�slicer8r5r9r))rr �vs   rr!zParseResults.__getitem__�sj���a�#�u��&��=�=��#�#��D�O�O�#��=�=��#�B�'��*�*��4�=�=��+;�<�a�Q�q�T�<�=�=��<s�A2c�z�||t�r;|jj|t��|gz|j|<|d}n^||tt
f�r||j|<|}n9|jj|g�t|d�gz|j|<|}||t�r||_yyr&)	rr9�getr>r*rVr8r)r4)r�krWr=�subs     r�__setitem__zParseResults.__setitem__�s����a�0�1�#�}�}�0�0��D�F�;�q�c�A�D�M�M�!���A�$�C�
��C��<�
(� �D�M�M�!���C�#�}�}�0�0��B�7�'��1�-�;� �D�M�M�!���C��c�<�(��C�K�)rc	���t|ttf�s|j|=yt	|j
�}|j
|=t|t�r|dkr||z
}t||dz�}t
t|j|���}|j�|jj�D]4}|D]-}t|�D]\}\}}t||||kDz
�||<��/�6y)Nrr
)
r=r*rVr9�lenr8r>�range�indices�reverse�values�	enumerater)	rr �mylen�removed�occurrences�jrZ�value�positions	         r�__delitem__zParseResults.__delitem__�s����!�c�5�\�*��
�
�a� ���D�M�M�"���M�M�!���a����1�u��U�
���a��Q���A��u�a�i�i��.�/�0�������=�=�/�/�1�	�K��
��,5�k�,B��(�A�(��x�%<��x�8�a�<�8�&�K��N��
�	rc��||jvSr�r9)rrZs  r�__contains__zParseResults.__contains__s���D�M�M�!�!rc�,�t|j�Sr)r^r8r#s r�__len__zParseResults.__len__
s���4�=�=�!�!rc�:�|jxs|jSr)r8r9r#s r�__bool__zParseResults.__bool__
s���
�
�6����7�7�7rc�,�t|j�Sr��iterr8r#s r�__iter__zParseResults.__iter__����D�M�M�"�"rc�8�t|jddd��S�NrUrsr#s r�__reversed__zParseResults.__reversed__s���D�M�M�$�B�$�'�(�(rc�,�t|j�Sr)rtr9r#s r�keyszParseResults.keysrvrc�6���fd��j�D�S)Nc3�(�K�|]	}�|���y�wrr�rrZrs  �rrz&ParseResults.values.<locals>.<genexpr>s�����-�A��Q��-�s��r{r#s`rrbzParseResults.valuess���-�����-�-rc�6���fd��j�D�S)Nc3�,�K�|]}|�|f���
y�wrrr~s  �rrz%ParseResults.items.<locals>.<genexpr>s�����2���D��G��2�s�rr#s`r�itemszParseResults.itemss���2�d�i�i�k�2�2rc��|jS)z�
        Since ``keys()`` returns an iterator, this method is helpful in bypassing
        code that looks for the existence of any defined results names.rlr#s r�haskeyszParseResults.haskeyss���}�}�$�$�$rc���|sdg}|j�D]\}}|dk(r|d|f}�td|����t|dt�st	|�dk(s|d|vr|d}||}||=|S|d}|S)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']
        rU�defaultrz)pop() got an unexpected keyword argument r
)r�r?r=r*r^)rr'rMrZrW�index�ret�defaultvalues        r�popzParseResults.pop%s���P��4�D��L�L�N�	S�D�A�q��I�~��Q���|���"K�A�5� Q�R�R�		S�
�d�1�g�s�#�s�4�y�A�~��a��D����G�E��u�+�C��U���J���7�L��rc��||vr||S|S)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   rrYzParseResults.get]s��$�$�;���9�� � rc���|jj||�|jj�D]-}t	|�D]\}\}}t||||kDz�||<��/y)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)r8�insertr9rbrcr)rr��
ins_stringrfrZrhris       rr�zParseResults.inserttso��"	
�
�
���U�J�/��=�=�/�/�1�	�K�(1�+�(>�
�$��$�E�8�!8��8�x�%�'7�8�"��A��
�	rc�:�|jj|�y)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)r8�append)r�items  rr�zParseResults.append�s��	
�
�
���T�"rc�~�t|t�r|j|�y|jj	|�y)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__r8�extend)r�itemseqs  rr�zParseResults.extend�s,���g�|�,��M�M�'�"��M�M� � ��)rc�V�|jdd�=|jj�y)z7
        Clear all elements and results names.
        N)r8r9�clearr#s rr�zParseResults.clear�s ��
�M�M�!���
�
���rc�d�	||S#t$r|jd�rt|��YywxYw)N�__rO)rP�
startswith�AttributeError)rrLs  r�__getattr__zParseResults.__getattr__�s:��	���:����	����t�$�$�T�*�*��	�s��%/�/c�0�|j�}||z
}|Sr)�copy)r�otherr�s   r�__add__zParseResults.__add__�s���i�i�k���u����
rc����|s|S|jr�t|j���fd�}|jj�}|D���cgc]&\}}|D]}|t	|d||d��f���(}}}}|D](\}}|||<t|dt�s�||d_�*|xj|jz
c_|xj|jzc_|Scc}}}w)Nc���|dkr�S|�zSr&r)�a�offsets �r�<lambda>z'ParseResults.__iadd__.<locals>.<lambda>�s���A��E�&��q�6�z�rrr
)	r9r^r8r�rr=r)r4r5)	rr��	addoffset�
otheritemsrZ�vlistrW�otherdictitemsr�s	        @rr�zParseResults.__iadd__�s������K��>�>�����'�F�A�I����-�-�/�J�!+����A�u�����+�A�a�D�)�A�a�D�/�B�C��C��N��
'�
(���1���Q���a��d�L�1�#'�A�a�D�L�
(�
	
�
�
����'�
����5�+�+�+�����s�+C(c�V�t|t�r|dk(r|j�S||zSr&)r=r*r�)rr�s  r�__radd__zParseResults.__radd__�s*���e�S�!�e�q�j��9�9�;���4�<�rc�n�t|�j�d|j�d|j��d�S)N�(�, �))r@r+r8�as_dictr#s r�__repr__zParseResults.__repr__�s2���t�*�%�%�&�a��
�
�'8��4�<�<�>�:J�!�L�Lrc
��ddj|jD�cgc](}t|t�rt	|�n
t|���*c}�zdzScc}w)N�[r��])�joinr8r=r)r2�reprrs  r�__str__zParseResults.__str__�s\����i�i�"�]�]���)��L�9�C��F�t�A�w�F���
��
�		
��s�-A
c���g}|jD]U}|r|r|j|�t|t�r||j	�z
}�<|jt|���W|Sr)r8r�r=r)�
_asStringListr2)r�sep�outr�s    rr�zParseResults._asStringList�s^�����M�M�	&�D��s��
�
�3���$��-��t�)�)�+�+���
�
�3�t�9�%�
	&��
rF)�flattenc����fd�}|r
g|���S�jD�cgc]$}t|t�r|j�n|��&c}Scc}w)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::

            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']
        c3��K�tjg���}|r@|j�}t|t�r|j|ddd��n|��|r�?yy�wrx)�collections�deque�popleftr=r)�
extendleft)�pr�to_visit�to_dors   �r�	flattenedz'ParseResults.as_list.<locals>.flattenedsV�����"�(�(��4��1�H�� �(�(�*���e�\�2��'�'��d��d��4��K��s�AA�A)r8r=r)�as_list)rr�r��ress`   rr�zParseResults.as_list�sV���"	 ��%�Y�t�_�%�%� �=�=���",�C��!>����
�C�G��
��s�)A
c�R���fd��t�fd�|j�D��S)a�
        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���t|t�r6|j�r|j�S|D�cgc]
}�|���c}S|Scc}wr)r=r)r�r�)�objrW�to_items  �rr�z%ParseResults.as_dict.<locals>.to_item5sA����#�|�,�(+���
�s�{�{�}�T�PS�;T�1�G�A�J�;T�T��
��<Us�A
c3�8�K�|]\}}|�|�f���y�wrr)rrZrWr�s   �rrz'ParseResults.as_dict.<locals>.<genexpr>;s�����=���1�Q���
�O�=�s�)rJr�)rr�s @rr�zParseResults.as_dict s!���*	��=��
�
��=�=�=rc���t|j�}|jj�|_|j|_|xj
|j
zc_|j|_|S)a
        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)r8r9r�r4r5r3)rr�s  rr�zParseResults.copy=sS���4�=�=�)���}�}�)�)�+����l�l������$�/�/�)���J�J��	��
rc�0�|j�}t|j�D]�\}}t|t�r|j�|j|<�4t|ttf�r�Kt|t�r]t|��x|j|<}|j�D]*\}}t|t�r|j�n|||<�,��t|t�s��t|�d�|D��|j|<��|S)zL
        Returns a new deep copy of a :class:`ParseResults` object.
        c3�`K�|]&}t|t�r|j�n|���(y�wr)r=r)�deepcopy)rrWs  rrz(ParseResults.deepcopy.<locals>.<genexpr>[s)����,�KL�J�q�,�$?�A�J�J�L�Q�F�,�s�,.)r�rcr8r=r)r�r2�bytesrr@r�r)rr�r r��destrZrWs       rr�zParseResults.deepcopyKs����i�i�k����
�
�.�	�F�A�s��#�|�,�"%�,�,�.����Q���C�#�u��.���C��0�)2��c���4����Q��$��I�I�K�Q�D�A�q�.8��L�.I�a�j�j�l�q�D��G�Q��C��*�"+�$�s�)�,�PS�,�#����Q��	��
rc�����jr�jS�jr;�j}|jj�}t	�fd�|D�d�St��dk(rxt�j�dk(r`t	t
�jj���dddvr,t	t
�jj���Sy)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
        c3�D�K�|]\}}|D]
\}}|�ur|����y�wrr)rrZr�rW�locrs     �rrz(ParseResults.get_name.<locals>.<genexpr>s=������ ��5�"'����3��D�y�����s� Nr
r)rrU)	r3r4r9r��nextr^rtrbr{)r�par�parent_tokdict_itemss`  r�get_namezParseResults.get_name`s����2�:�:��:�:��
�\�\� $���C�#&�<�<�#5�#5�#7� ���$8����
�
��I��N��D�M�M�"�a�'��T�$�-�-�.�.�0�1�2�1�5�a�8�G�C���T�]�]�/�/�1�2�3�3�rc���g}d}|j|r|t|j��znd�|sdj|�S|j	�r�td�|j
�D��}|D]�\}}	|r|j|�|j|�d|z�d|�d��t|	t�s|jt|	���`|	s|jt|	���}|j|	j||||dz�����td	�|D��sdj|�S|}	d}
d}t|	�D]�\}}
t|
t�rE|
j||||dz��}|j|�|�|
|z�d
|�d|�|�|
|dzz�|��
��[|j|�|�|
|z�d
|�d|�|�|
|dzz�|
��
���dj|�S)aM
        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'
        �
rOc3�<K�|]\}}t|�|f���y�wr)r2)rrZrWs   rrz$ParseResults.dump.<locals>.<genexpr>�s����@�4�1�a�C��F�A�;�@���z  z- z: r
)�indent�full�include_list�_depthc3�<K�|]}t|t����y�wr)r=r))r�vvs  rrz$ParseResults.dump.<locals>.<genexpr>�s����?�B�:�b�,�/�?�r�r�z]:)
r�r2r�r�r��sortedr�r=r)r��dump�anyrc)rr�r�r�r�r��NLr�rZrW�incr�nlr r��vv_dumps               rr�zParseResults.dump�s��*��
���
�
�<�6�C�����/�/�R�H���7�7�3�<���<�<�>��@�4�:�:�<�@�@�E��
���1���J�J�r�N��
�
�f�X�t�f�}�%6�b���2�>�?�!�!�\�2��J�J�t�A�w�'����J�J�s�1�v�&���
�
��F�F�%�!�%1�%��z�	���
�(�?�$�?�?��7�7�3�<������
���q�\�	�E�A�r��"�l�+��'�'�!��!-�!�A�:�	"����
�
��d�6�(�4�&�=�/��1�#�R��t�F�8�D�F�UV�J�DW�CX�Y`�Xa�b���
�
��d�6�(�4�&�=�/��1�#�R��t�F�8�D�F�UV�J�DW�CX�Y[�X\�]��	� �w�w�s�|�rc�R�tj|j�g|��i|��y)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�)rr'rMs   rr�zParseResults.pprint�s ��2	�
�
�d�l�l�n�6�t�6�v�6rc�~�|j|jj�d|j|jffSr)r8r9r�r5r3r#s rr$zParseResults.__getstate__�s9���M�M��
�
�"�"�$������
�
�	
�
�	
rc�d�|\|_\|_}}|_t|�|_d|_yr)r8r9r3rHr5r4)r�stater��inAccumNamess    rr(zParseResults.__setstate__s.��HM�E��
�E��
�s�L�$�*��l�+�����rc�2�|j|jfSr)r8r3r#s r�__getnewargs__zParseResults.__getnewargs__s���}�}�d�j�j�(�(rc�^�tt|��t|j��zSr)�dirr@r>r{r#s r�__dir__zParseResults.__dir__	s ���4��:���d�i�i�k�!2�2�2rc	���d�}|g�}|j�D]A\}}t|t�r||j||��z
}�-|||g|||���z
}�C|�||g|��}|S)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�Z�	t|�t|t�S#t$rYywxYw)NF)rtr=r�	Exception)r�s r�is_iterablez+ParseResults.from_dict.<locals>.is_iterables4��
5��S�	�
&�c�8�4�4�4��	�
��
�s��	*�*)rL)rLrR)r�r=r�	from_dict)rBr�rLr�r�rZrWs       rr�zParseResults.from_dicts���	5��"�g���K�K�M�	?�D�A�q��!�W�%��s�}�}�Q�Q�}�/�/���s�A�3�Q�{�1�~�>�>��		?�
���s�e�$�'�C��
r)NN)�return�None)r�r6)r�r*)r�rr)r�r)r�r))r�r))r�r2)rO)r�r6r�r>)r�rJ)r�z
str | None)rOTTr)5r+r,r-rDr1r.r/r>rErAr=rr!r\rjrmrorqruryr{rbr�r�r�rYr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r$r(r�r��classmethodr�rR�asDict�getNamerrrr)r)'sb��+�Z&*�2�r�N�L�/�2��J�
�����L������I�0%�t�0%�d�0��d�$�:�%"�	
�%"�N>�,6�
��0"�"�8�#�)�#�.�3�%�6 �p!�.�2#�"*�(���
�, �M�

�	�*/� �D>�:��*.�`H�T7�8	
��
)�3�����4�F�+�
�F�+��G�,rr))�
__future__rr��collections.abcrrrrrr��typingr	�utilrr2r�rr.r@rIrr)�registerrrr�<module>rsx��"������"�"�5�\��
�)���2��'����"E-�E-�P�����%������&r