Your IP : 13.59.141.195
�
��bg?# � �p � d dl Z d dlZd dlZddlmZmZmZmZ ddlm Z
G d� de
j e
j e
j
e
j e
j � � Z eej � � Z e j dez dz � � Z G d � d
e� � Z G d� de� � Z G d
� de� � Z G d� de� � Z G d� de� � ZdS )� N� )�col�line�lineno�_collapse_string_to_ranges)�pyparsing_unicodec � � e Zd ZdS )�ExceptionWordUnicodeN)�__name__�
__module__�__qualname__� � �e/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pyparsing/exceptions.pyr
r
s � � � � � ��Dr r
z([z
]{1,16})|.c � � e Zd ZdZ ddededej e fd�Ze dd �� � Z
ed
� � � Ze
defd�� � Ze
defd
�� � Ze
defd�� � Ze
defd�� � Zdefd�Zd� Zddd�dedefd�Zddefd�ZeZdS )�ParseBaseExceptionz7base exception class for all parsing runtime exceptionsr N�pstr�loc�msgc � � || _ |�|| _ d| _ n|| _ || _ |x| _ | _ |||f| _ d S )N� )r r r �parser_element�
parserElement�args)�selfr r r �elems r �__init__zParseBaseException.__init__ sP � � ����;��D�H��D�I�I��D�H��D�I�37�7���d�0��3��$�� � � r � c � � ddl }ddlm} |�t j � � }g }t | t � � r=|� | j � � |� d| j dz
z dz � � |� d�
t | � � j | � � � � |dk �r�|�
| j |�� � }t � � }t! || d� � � D �]M\ }}|d } | j � d d� � }
t |
|� � r�| j j d
vr�Ht+ |
� � |v r�Z|� t+ |
� � � � t |
� � }|� d�
|j |j |
� � � � n�|
�Ct |
� � }|� d�
|j |j � � � � n?| j }|j d
v r��|� d�
|j � � � � |dz }|s n��Od� |� � 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.
r Nr )�
ParserElement� �^z{}: {})�contextr )� parseImpl�
_parseNoCachez
{}.{} - {}z{}.{})�wrapperz<module>z{}�
)�inspect�corer �sys�getrecursionlimit�
isinstancer �appendr �column�format�typer �getinnerframes�
__traceback__�set� enumerate�f_locals�get�f_code�co_name�id�addr �join)
�exc�depthr( r �ret�callers�seen�i�ff�frm�f_self� self_type�codes
r �explain_exceptionz$ParseBaseException.explain_exception) sW � �"