%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/pyparsing/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/pyparsing/__pycache__/exceptions.cpython-312.pyc

�

&
�d3%�	��ddlZddlZddlZddlmZmZmZmZmZddl	m
ZGd�dejejejejej �Zeej$�Zej(dezdz�ZGd	�d
e�ZGd�de�ZGd
�de�ZGd�de�ZGd�de�Zy)�N�)�col�line�lineno�_collapse_string_to_ranges�replaced_by_pep8)�pyparsing_unicodec��eZdZy)�ExceptionWordUnicodeN)�__name__�
__module__�__qualname__���6/usr/lib/python3/dist-packages/pyparsing/exceptions.pyrrs��rrz([z
]{1,16})|.c���eZdZUdZeed<eed<eed<ejed<ejeeejefed<dZ			ddededejefd	�Ze
dd
��Zed��Zedefd
��Zedefd��Zedefd��Zedefd��Zed��Zej.d��Zdefd�Zd�Z	ddd�dejededefd�Zddefd�Zee�d��Zy)�ParseBaseExceptionz7base exception class for all parsing runtime exceptions�loc�msg�pstr�parser_element�args�rrrrrNc�r�||_|�||_d|_n||_||_||_|||f|_y)N�r)�selfrrr�elems     r�__init__zParseBaseException.__init__,sB������;��D�H��D�I��D�H��D�I�"����3��$��	rc�<�ddl}ddlm}|�tj�}g}t|t�r?|j|j�|jd|jdz
zdz�|jt|�j�d|���|dkD�rl|j|j|��}t�}t||d�D�]2\}}|d}	|	j j#d	d�}
t|
|�r�|	j$j&j)d
�s�Zt+|
�|vr�h|j-t+|
��t|
�}|j|j.�d|j�d|
���no|
�6t|
�}|j|j.�d|j���n7|	j$}|j&d
vr��|j|j&�|dz}|r��3ndj1|�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�getinnerframes�
__traceback__�set�	enumerate�f_locals�get�f_code�co_name�
startswith�id�addr
�join)
�exc�depthr)r �ret�callers�seen�i�ff�frm�f_self�	self_type�codes
             r�explain_exceptionz$ParseBaseException.explain_exception=s���"	�'��=��)�)�+�E����c�-�.��J�J�s�x�x� ��J�J�s�c�j�j�1�n�-��3�4��
�
�d�3�i�(�(�)��C�5�1�2��1�9��,�,�S�->�->��,�N�G��5�D�"�7�E�6�7�#3�4�
���2���e�����)�)�&�$�7���f�m�4��:�:�-�-�8�8�6��!��&�z�T�)� ��H�H�R��Z�(� $�V��I��J�J�$�/�/�0��)�2D�2D�1E�S���Q���'� $�V��I��J�J�)�"6�"6�!7�q��9K�9K�8L�M�N��:�:�D��|�|�'>�>� ��J�J�t�|�|�,���
����?
�B�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_exceptions'���2�7�7�B�F�F�B�F�F�B�,=�,=�>�>r�returnc�B�t|j|j�S)zG
        Return the line of text where the exception occurred.
        )rrr�rs rrzParseBaseException.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.
        )rrrrOs rrzParseBaseException.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.
        �rrrrOs rrzParseBaseException.col����
�4�8�8�T�Y�Y�'�'rc�B�t|j|j�SrRrSrOs rr/zParseBaseException.column�rTrc��|jS�N�rrOs r�
parserElementz ParseBaseException.parserElement�s���"�"�"rc��||_yrWrX)rrs  rrYz ParseBaseException.parserElement�s
��"��rc	���|jr�|jt|j�k\rd}n|tj	|j|j�}|�|jd�}n&|j|j|jdz}d|zj
dd�}nd}|j�|�d|j�d	|j�d
|j�d�	S)Nz, found end of textrrz
, found %rz\\�\rz  (at char z	), (line:z, col:�))
rr�len�_exception_word_extractor�match�group�replacerrr/)r�foundstr�found_match�founds    r�__str__zParseBaseException.__str__�s����9�9��x�x�3�t�y�y�>�)�0��8�=�=�d�i�i����R���*�'�-�-�a�0�E� �I�I�d�h�h����A��>�E�(�5�0�9�9�%��F���H��(�(��H�:�[����
�)�D�K�K�=�PV�W[�Wb�Wb�Vc�cd�e�erc��t|�SrW)�strrOs r�__repr__zParseBaseException.__repr__�s���4�y�rz>!<)�markerString�
marker_stringrjc��|�|n|}|j}|jdz
}|rdj|d||||df�}|j�S)z�
        Extracts the exception line from the input string, and marks
        the location of the exception with a special symbol.
        Nrr)rr/r<�strip)rrkrj�line_str�line_columns     r�mark_input_linez"ParseBaseException.mark_input_line�s^��)6�(A�}�|���9�9���k�k�A�o����w�w��,�;�'��x���7M�N��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::

            expr = pp.Word(pp.nums) * 3
            try:
                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``
        )rH)rr>s  r�explainzParseBaseException.explain�s��J�%�%�d�E�2�2rc��yrWrrOs r�
markInputlinez ParseBaseException.markInputline�s�� r)rNN)�rW)rr
r�__doc__�int�__annotations__rh�typing�Any�Tuple�Optional�	__slots__r�staticmethodrH�classmethodrL�propertyrrrr/rY�setterrfrirprrrrtrrrrrs���A�	�H�	�H�

�I��J�J��
�,�,�s�C�����!5�5�
6�6��I��$(�
�%��%��%��_�_�S�
!�	%�"�?��?�B�?��?��)�c�)��)��+��+��+��(�S�(��(��(��(��(��#��#����#��#�f��f� �59� �QV� �#�_�_�S�1� �KN� �	� � %3�3�%3�P�o�&� �'� rrc��eZdZdZy)�ParseExceptionaq
    Exception thrown when a parse expression doesn't match the input string

    Example::

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

    prints::

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

    N�rr
rrvrrrr�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�Zdefd�Zy)�RecursiveGrammarExceptionz�
    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>`
    c��||_yrW��parseElementTrace)r�parseElementLists  rrz"RecursiveGrammarException.__init__'s
��!1��rrMc� �d|j��S)NzRecursiveGrammarException: r�rOs rrfz!RecursiveGrammarException.__str__*s��,�T�-C�-C�,D�E�ErN)rr
rrvrrhrfrrrr�r� s���2�F��Frr�)�rer+ry�utilrrrrr�unicoder	�ppu�Latin1�LatinA�LatinB�Greek�Cyrillicr�	alphanums�_extract_alphanums�compiler_�	Exceptionrr�r�r�r�rrr�<module>r�s���
�
�
���.�	�3�:�:�s�z�z�3�:�:�s�y�y�#�,�,�	�0�0D�0N�0N�O��&�B�J�J�t�.@�'@�<�'O�P��_!��_!�F�'��(�,���.��F�	�Fr

Zerion Mini Shell 1.0