ó
    jñ:i@(  ã            	      ó¨  • S SK Jr  S SKrS SKrS SKrS SKrS SKJr  SSKJ	r
  SSKJrJrJrJrJr   " S S\
R"                  \
R$                  \
R&                  \
R(                  \
R*                  5      r\" \R.                  5      r\R2                  " S	\-   S
-   5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r g)é    )ÚannotationsN)Úcached_propertyé   )Úpyparsing_unicode)Ú_collapse_string_to_rangesÚcolÚlineÚlinenoÚreplaced_by_pep8c                  ó   • \ rS rSrSrg)Ú_ExceptionWordUnicodeSeté   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r   ó    ÚW/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/pyparsing/exceptions.pyr   r      s   † ò 	r   r   z([z
]{1,16})|.c                  ó˜  • \ rS rSr% SrS\S'   S\S'   S\S'   S\S	'   S
\S'   Sr   S"       S#S jjr\S$S%S jj5       r	\
S&S j5       r\S'S j5       r\S(S j5       r\S(S j5       r\S(S j5       r\S'S j5       r\S 5       r\R(                  S 5       rS rS'S jrS'S jrS r S)SS.     S*S jjjrS$S+S jjr\" S \5      rS!rg),ÚParseBaseExceptioné   z7base exception class for all parsing runtime exceptionsÚintÚlocÚstrÚmsgÚpstrz
typing.AnyÚparser_elementz%tuple[str, int, typing.Optional[str]]Úargs©r   r   r   r   r    Nc                óR   • Uc  USpX l         X0l        Xl        X@l        XU4U l        g )NÚ r!   )Úselfr   r   r   Úelems        r   Ú__init__ÚParseBaseException.__init__1   s1   € ð ‰;Ø˜b�àŒØŒØŒ	Ø"ÔØ Ð$ˆ�	r   c                óŽ  • SSK nSSKJn  Uc  [        R                  " 5       n/ n[        U [        5      (       a;  UR                  U R                  5        UR                  SSU R                   3 5        UR                  [        U 5      R                   SU  35        US::  d  U R                  c  SR                  U5      $ UR                  U R                  US	9n[        5       nXQ* S  GHF  nUS   nUR                   R#                  S
S5      n	[        X“5      (       a�  UR$                  R&                  R)                  S5      (       d  Ma  [+        U	5      U;   a  Mr  UR-                  [+        U	5      5        [        U	5      n
UR                  U
R.                   SU
R                   SU	 35        OsU	b6  [        U	5      n
UR                  U
R.                   SU
R                   35        O:UR$                  nUR&                  S;   a  GM  UR                  UR&                  5        US-  nU(       a  GMG    O   SR                  U5      $ )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Ú_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Údepthr2   r)   ÚretÚcallersÚseenÚffÚfrmÚf_selfÚ	self_typeÚcodes               r   Úexplain_exceptionÚ$ParseBaseException.explain_exceptionA   sì  € ó" 	Ý'à‰=Ü×)Ò)Ó+ˆEØˆÜ�cÔ-×.Ñ.Ø�J‰J�s—x‘xÔ Ø�J‰J˜#˜a §
¡
˜|˜^Ð,Ô.Ø�
‰
”d˜3“i×(Ñ(Ð)¨¨C¨5Ð1Ô2à�A‹:˜×*Ñ*Ñ2Ø—9‘9˜S“>Ð!à×(Ñ(¨×):Ñ):ÀEÐ(ÐJˆÜ›ˆØ˜&˜'Ô"ˆBØ�Q‘%ˆCà—\‘\×%Ñ% f¨dÓ3ˆFÜ˜&×0Ñ0Ø—z‘z×)Ñ)×4Ñ4Ð5S×TÑ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ß‘5Ùñ7 #ð: �y‰y˜‹~Ðr   c                óh   • U " UR                   UR                  UR                  UR                  5      $ )z”
internal factory method to simplify creating one type of ParseException
from another - avoids having __init__ signature conflicts among subclasses
)r   r   r   r   )ÚclsÚpes     r   Ú_from_exceptionÚ"ParseBaseException._from_exception�   s'   € ñ �2—7‘7˜BŸF™F B§F¡F¨B×,=Ñ,=Ó>Ð>r   c                óB   • [        U R                  U R                  5      $ )z7
Return the line of text where the exception occurred.
)r	   r   r   ©r$   s    r   r	   ÚParseBaseException.line‰   s   € ô
 �D—H‘H˜dŸi™iÓ(Ð(r   c                óB   • [        U R                  U R                  5      $ )zF
Return the 1-based line number of text where the exception occurred.
)r
   r   r   rW   s    r   r
   ÚParseBaseException.lineno�   s   € ô
 �d—h‘h §	¡	Ó*Ð*r   c                óB   • [        U R                  U R                  5      $ ©zM
Return the 1-based column on the line of text where the exception occurred.
©r   r   r   rW   s    r   r   ÚParseBaseException.col—   ó   € ô
 �4—8‘8˜TŸY™YÓ'Ð'r   c                óB   • [        U R                  U R                  5      $ r\   r]   rW   s    r   r8   ÚParseBaseException.columnž   r_   r   c                ón  • U R                   (       d  gU R                  [        U R                   5      :¼  a  g[        R	                  U R                   U R                  5      nUb  UR                  S5      nO&U R                   U R                  U R                  S-    n[        U5      R                  SS5      $ )Nr#   zend of textr   r   z\\Ú\)r   r   ÚlenÚ_exception_word_extractorÚmatchÚgroupÚreprÚreplace)r$   Úfound_matchÚ
found_texts      r   ÚfoundÚParseBaseException.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Ð4r   c                ó   • U R                   $ ©N©r   rW   s    r   ÚparserElementÚ ParseBaseException.parserElement·   s   € à×"Ñ"Ð"r   c                ó   • Xl         g ro   rp   )r$   r%   s     r   rq   rr   »   s   € à"Õr   c                ó.   • [         R                   " U 5      $ ro   )ÚcopyrW   s    r   ru   ÚParseBaseException.copy¿   s   € Ü�yŠy˜‹Ðr   c           	     ó¶   • U R                   (       a  SU R                    3OSnU R                   U SU R                   SU R                   SU R                   S3	$ )z…
Output the formatted exception message.
Can be overridden to customize the message formatting or contents.

.. versionadded:: 3.2.0
z, found r#   z  (at char z	), (line:z, col:Ú))rl   r   r   r
   r8   )r$   Úfound_phrases     r   Úformatted_messageÚ$ParseBaseException.formatted_messageÂ   sU   € ð 37·*·*˜ $§*¡* Ñ.À"ˆØ—(‘(�˜L˜>¨°T·X±X°J¸iÈÏÉÀ}ÐTZÐ[_×[fÑ[fÐZgÐghÐiÐir   c                ó"   • U R                  5       $ )zT
.. versionchanged:: 3.2.0
   Now uses :meth:`formatted_message` to format message.
)rz   rW   s    r   Ú__str__ÚParseBaseException.__str__Ì   s   € ð
 ×%Ñ%Ó'Ð'r   c                ó   • [        U 5      $ ro   )r   rW   s    r   Ú__repr__ÚParseBaseException.__repr__Ó   s   € Ü�4‹yÐr   z>!<)ÚmarkerStringc               óŽ   • Ub  UOUnU R                   nU R                  S-
  nU(       a  USU  U X4S  3nUR                  5       $ )zs
Extracts the exception line from the input string, and marks
the location of the exception with a special symbol.
Nr   )r	   r8   Ústrip)r$   Úmarker_stringr‚   Úline_strÚline_columns        r   Úmark_input_lineÚ"ParseBaseException.mark_input_lineÖ   sV   € ð )6Ñ(A‘}À|ˆØ—9‘9ˆØ—k‘k A‘oˆÞØ" < KÐ0Ð1°,°ÀÈÐ@VÐ?WÐXˆHØ�~‰~ÓÐr   c                ó$   • U R                  X5      $ )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:

.. testcode::

    # 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:

.. testoutput::

    123 456 A789
            ^
    ParseException: Expected W:(0-9), found 'A789'  (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``
)rO   )r$   rF   s     r   ÚexplainÚParseBaseException.explainä   s   € ðV ×%Ñ% dÓ2Ð2r   ÚmarkInputline)r    r   r   r   r   )r   NN)r   r   r   r   r   útyping.Optional[str]ÚreturnÚNone)é   )rE   Ú	ExceptionrF   r   r�   r   )r�   r   ©r�   r   )r�   r   ro   )r…   rŽ   r‚   r   r�   r   )rF   r   r�   r   )r   r   r   r   Ú__doc__Ú__annotations__Ú	__slots__r&   ÚstaticmethodrO   ÚclassmethodrT   r   r	   r
   r   r8   rl   Úpropertyrq   Úsetterru   rz   r}   r€   rˆ   r‹   r   r�   r   r   r   r   r   r      sk  ‡ ÙAà	ƒHØ	ƒHØ
ƒIØÓØ
/Ó/ð€Ið Ø$(Øð%àð%ð ð%ð "ð	%ð 
õ%ð  õ=ó ð=ð~ ó?ó ð?ð ó)ó ð)ð ó+ó ð+ð ó(ó ð(ð ó(ó ð(ð ó5ó ð5ð" ñ#ó ð#ð ×Ññ#ó ð#òôjô(òð 59ð ØQVñ Ø1ð ØKNð à	ö ö+3ñ^ % _°oÓFƒMr   r   c                  ó   • \ rS rSrSrSrg)ÚParseExceptioni  am  
Exception thrown when a parse expression doesn't match the input string

Example:

.. testcode::

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

prints:

.. testoutput::

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

r   N©r   r   r   r   r”   r   r   r   r   rœ   rœ     s   † ôr   rœ   c                  ó   • \ rS rSrSrSrg)ÚParseFatalExceptioni.  zi
User-throwable exception thrown when inconsistent parse content
is found; stops all parsing immediately
r   Nr�   r   r   r   rŸ   rŸ   .  s   † ôr   rŸ   c                  ó   • \ rS rSrSrSrg)ÚParseSyntaxExceptioni5  zß
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.
r   Nr�   r   r   r   r¡   r¡   5  s   † ôr   r¡   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	ÚRecursiveGrammarExceptioni>  a4  
.. deprecated:: 3.0.0
   Only used by the deprecated :meth:`ParserElement.validate`.

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                ó   • Xl         g ro   ©ÚparseElementTrace)r$   ÚparseElementLists     r   r&   Ú"RecursiveGrammarException.__init__H  s   € Ø!1Õr   c                ó    • SU R                    3$ )NzRecursiveGrammarException: r¥   rW   s    r   r}   Ú!RecursiveGrammarException.__str__K  s   € Ø,¨T×-CÑ-CÐ,DÐEÐEr   r¥   N)r�   r�   r“   )r   r   r   r   r”   r&   r}   r   r   r   r   r£   r£   >  s   † ñô2÷Fr   r£   )!Ú
__future__r   ru   Úrer4   ÚtypingÚ	functoolsr   Úunicoder   ÚppuÚutilr   r   r	   r
   r   ÚLatin1ÚLatinAÚLatinBÚGreekÚCyrillicr   Ú	alphanumsÚ_extract_alphanumsÚcompilere   r’   r   rœ   rŸ   r¡   r£   r   r   r   Ú<module>rº      sÁ   ðå "ã Û 	Û 
Û Ý %å -÷õ ô	Ø‡J�J�—
‘
˜CŸJ™J¨¯	©	°3·<±<ô	ñ 0Ð0H×0RÑ0RÓSÐ ØŸJšJ tÐ.@Ñ'@À<Ñ'OÓPÐ ôuG˜ô uGôrÐ'ô ô.Ð,ô ôÐ.ô ôF 	õ Fr   