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__/exceptions.cpython-312.pyc
�

�S�g�&�	��ddlmZddlZddlZddlZddlZddlmZddlm	Z
ddlmZm
Z
mZmZmZGd�de
j"e
j$e
j&e
j(e
j*�Zeej.�Zej2d	ezd
z�ZGd�de�ZGd
�de�ZGd�de�ZGd�de�ZGd�de�Z y)�)�annotationsN)�cached_property�)�pyparsing_unicode)�_collapse_string_to_ranges�col�line�lineno�replaced_by_pep8c��eZdZy)�_ExceptionWordUnicodeSetN)�__name__�
__module__�__qualname__����/build/snapcraft-certbot-29b1212f749eeba2f1dece1adfe9a83a/parts/certbot/install/lib/python3.12/site-packages/pyparsing/exceptions.pyr
r
s��	rr
z([z
]{1,16})|.c�j�eZdZUdZded<ded<ded<ded<d	ed
<dZ			d 					d!d
�Zed"d#d��Ze	d$d��Z
ed%d��Zed&d��Z
ed&d��Zed&d��Zed%d��Zed��Zej&d��Zd�Zd%d�Zd%d�Zd�Z	d'dd�					d(d�Zd"d)d�Zede�Zy)*�ParseBaseExceptionz7base exception class for all parsing runtime exceptions�int�loc�str�msg�pstrz
typing.Any�parser_elementz%tuple[str, int, typing.Optional[str]]�args�rrrrrNc�\�|�|d}}||_||_||_||_|||f|_y)N�r)�selfrrr�elems     r�__init__zParseBaseException.__init__1s=���;��b��C���������	�"����3��$��	rc�\�ddl}ddlm}|�tj�}g}t|t�r?|j|j�|jd|jdz
z�d��|jt|�j�d|���|dks|j�dj|�S|j|j|�	�}t�}||dD�]/}|d}|j j#d
d�}	t|	|�r�|j$j&j)d�s�Wt+|	�|vr�e|j-t+|	��t|	�}
|j|
j.�d|
j�d
|	���no|	�6t|	�}
|j|
j.�d|
j���n7|j$}|j&dvr��|j|j&�|dz}|r��0ndj|�S)a�
        Method to take an exception and translate the Python internal traceback into a list
        of the pyparsing expressions that caused the exception to be raised.

        Parameters:

        - exc - exception raised during parsing (need not be a ParseException, in support
          of Python exceptions that might be raised in a parse action)
        - depth (default=16) - number of levels back in the stack trace to list expression
          and function names; if None, the full stack trace names will be listed; if 0, only
          the failing input line, marker, and exception string will be shown

        Returns a multi-line string listing the ParserElements and/or function names in the
        exception's stack trace.
        rNr)�
ParserElement� �^z: �
)�contextr )�	parseImpl�
_parseNoCache�.z - )�wrapperz<module>)�inspect�corer$�sys�getrecursionlimit�
isinstancer�appendr	�column�typer�
__traceback__�join�getinnerframes�set�f_locals�get�f_code�co_name�
startswith�id�addr)�exc�depthr-r$�ret�callers�seen�ff�frm�f_self�	self_type�codes            r�explain_exceptionz$ParseBaseException.explain_exceptionAs���"	�'��=��)�)�+�E����c�-�.��J�J�s�x�x� ��J�J�#����a��0�1��3�4��
�
�d�3�i�(�(�)��C�5�1�2��A�:��*�*�2��9�9�S�>�!��(�(��):�):�E�(�J������5�&�'�"�	�B��Q�%�C��\�\�%�%�f�d�3�F��&�-�0��z�z�)�)�4�4�5S�T���f�:��%������F��$� ��L�	��
�
�i�2�2�3�1�Y�5G�5G�4H��F�8�T�U��#� ��L�	��
�
�i�2�2�3�1�Y�5G�5G�4H�I�J��z�z���<�<�#:�:���
�
�4�<�<�(��Q�J�E���7	�:�y�y��~�rc�h�||j|j|j|j�S)z�
        internal factory method to simplify creating one type of ParseException
        from another - avoids having __init__ signature conflicts among subclasses
        )rrrr)�cls�pes  r�_from_exceptionz"ParseBaseException._from_exception�s'���2�7�7�B�F�F�B�F�F�B�,=�,=�>�>rc�B�t|j|j�S)zG
        Return the line of text where the exception occurred.
        )r	rr�r s rr	zParseBaseException.line�s��
�D�H�H�d�i�i�(�(rc�B�t|j|j�S)zV
        Return the 1-based line number of text where the exception occurred.
        )r
rrrPs rr
zParseBaseException.lineno�s��
�d�h�h��	�	�*�*rc�B�t|j|j�S�z]
        Return the 1-based column on the line of text where the exception occurred.
        �rrrrPs rrzParseBaseException.col����
�4�8�8�T�Y�Y�'�'rc�B�t|j|j�SrSrTrPs rr3zParseBaseException.column�rUrc�`�|jsy|jt|j�k\rytj	|j|j�}|�|jd�}n&|j|j|jdz}t
|�jdd�S)Nrzend of textrrz\\�\)rr�len�_exception_word_extractor�match�group�repr�replace)r �found_match�
found_texts   r�foundzParseBaseException.found�s����y�y���8�8�s�4�9�9�~�%� �0�5�5�d�i�i����J���"�$�*�*�1�-�J����4�8�8�d�h�h��l�;�J��J��'�'��t�4�4rc��|jS�N�rrPs r�
parserElementz ParseBaseException.parserElement�s���"�"�"rc��||_yrcrd)r r!s  rrez ParseBaseException.parserElement�s
��"��rc�,�tj|�Src)�copyrPs rrhzParseBaseException.copy�s���y�y���rc	��|jrd|j��nd}|j�|�d|j�d|j�d|j�d�	S)Nz, found rz  (at char z	), (line:z, col:�))rarrr
r3)r �found_phrases  r�formatted_messagez$ParseBaseException.formatted_message�sS��26�*�*��$�*�*��.�"���(�(��L�>��T�X�X�J�i����}�TZ�[_�[f�[f�Zg�gh�i�irc�"�|j�Src)rlrPs r�__str__zParseBaseException.__str__�s���%�%�'�'rc��t|�Src)rrPs r�__repr__zParseBaseException.__repr__�s���4�y�rz>!<)�markerStringc��|�|n|}|j}|jdz
}|r|d|�|�||d��}|j�S)z�
        Extracts the exception line from the input string, and marks
        the location of the exception with a special symbol.
        Nr)r	r3�strip)r �
marker_stringrq�line_str�line_columns     r�mark_input_linez"ParseBaseException.mark_input_line�sX��)6�(A�}�|���9�9���k�k�A�o���"�<�K�0�1�,�����@V�?W�X�H��~�~��rc�&�|j||�S)a�
        Method to translate the Python internal traceback into a list
        of the pyparsing expressions that caused the exception to be raised.

        Parameters:

        - depth (default=16) - number of levels back in the stack trace to list expression
          and function names; if None, the full stack trace names will be listed; if 0, only
          the failing input line, marker, and exception string will be shown

        Returns a multi-line string listing the ParserElements and/or function names in the
        exception's stack trace.

        Example::

            # an expression to parse 3 integers
            expr = pp.Word(pp.nums) * 3
            try:
                # a failing parse - the third integer is prefixed with "A"
                expr.parse_string("123 456 A789")
            except pp.ParseException as pe:
                print(pe.explain(depth=0))

        prints::

            123 456 A789
                    ^
            ParseException: Expected W:(0-9), found 'A'  (at char 8), (line:1, col:9)

        Note: the diagnostic output will include string representations of the expressions
        that failed to parse. These representations will be more helpful if you use `set_name` to
        give identifiable names to your expressions. Otherwise they will use the default string
        forms, which may be cryptic to read.

        Note: pyparsing's default truncation of exception tracebacks may also truncate the
        stack of expressions that are displayed in the ``explain`` output. To get the full listing
        of parser expressions, you may have to set ``ParserElement.verbose_stacktrace = True``
        )rJ)r rAs  r�explainzParseBaseException.explain�s��N�%�%�d�E�2�2r�
markInputline)rNN)rrrrr�typing.Optional[str])�)r@�	ExceptionrAr�returnr)r~r�r~r)r~rrc)rtr{rqrr~r)rArr~r)rrr�__doc__�__annotations__�	__slots__r"�staticmethodrJ�classmethodrNrr	r
rr3ra�propertyre�setterrhrlrnrprwryrrzrrrrrsa��A�	�H�	�H�

�I���
/�/��I��$(�
�%��%��%�"�	%� �=��=�~�?��?��)��)��+��+��(��(��(��(��5��5�"�#��#����#��#��j�(��59� �QV� �1� �KN� �	� �'3�V%�_�o�F�Mrrc��eZdZdZy)�ParseExceptiona{
    Exception thrown when a parse expression doesn't match the input string

    Example::

        integer = Word(nums).set_name("integer")
        try:
            integer.parse_string("ABC")
        except ParseException as pe:
            print(pe)
            print(f"column: {pe.column}")

    prints::

       Expected integer (at char 0), (line:1, col:1) column: 1

    N�rrrr�rrrr�r�	s��rr�c��eZdZdZy)�ParseFatalExceptionzu
    User-throwable exception thrown when inconsistent parse content
    is found; stops all parsing immediately
    Nr�rrrr�r�s��rr�c��eZdZdZy)�ParseSyntaxExceptionz�
    Just like :class:`ParseFatalException`, but thrown internally
    when an :class:`ErrorStop<And._ErrorStop>` ('-' operator) indicates
    that parsing is to stop immediately because an unbacktrackable
    syntax error has been found.
    Nr�rrrr�r�$s��rr�c��eZdZdZd�Zdd�Zy)�RecursiveGrammarExceptiona6
    Exception thrown by :class:`ParserElement.validate` if the
    grammar could be left-recursive; parser may need to enable
    left recursion using :class:`ParserElement.enable_left_recursion<ParserElement.enable_left_recursion>`

    Deprecated: only used by deprecated method ParserElement.validate.
    c��||_yrc��parseElementTrace)r �parseElementLists  rr"z"RecursiveGrammarException.__init__6s
��!1��rc� �d|j��S)NzRecursiveGrammarException: r�rPs rrnz!RecursiveGrammarException.__str__9s��,�T�-C�-C�,D�E�ErNr)rrrr�r"rnrrrr�r�-s���2�Frr�)!�
__future__rrh�rer/�typing�	functoolsr�unicoder�ppu�utilrrr	r
r�Latin1�LatinA�LatinB�Greek�Cyrillicr
�	alphanums�_extract_alphanums�compilerZr}rr�r�r�r�rrr�<module>r�s���"��	�
�
�%�-���	��J�J��
�
�C�J�J��	�	�3�<�<�	�0�0H�0R�0R�S��&�B�J�J�t�.@�'@�<�'O�P��gG��gG�V�'��(�,���.��
F�	�
Fr