Ë
    äØjj3%  ã            	       óˆ  — d dl Z d dlZd dlZddlmZmZmZmZmZ ddl	m
Z  G d„ dej                  ej                  ej                  ej                  ej                   «      Z eej$                  «      Z e j(                  dez   dz   «      Z G d	„ d
e«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zy)é    Né   )ÚcolÚlineÚlinenoÚ_collapse_string_to_rangesÚreplaced_by_pep8)Úpyparsing_unicodec                   ó   — e Zd Zy)ÚExceptionWordUnicodeN)Ú__name__Ú
__module__Ú__qualname__© ó    úb/opt/eval-harness/bench_task/venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/exceptions.pyr   r      s   „ Ør   r   z([z
]{1,16})|.c                   óî  — e Zd ZU dZeed<   eed<   eed<   ej                  ed<   ej                  eeej                  e   f   ed<   dZ	 	 	 ddededej                  e   fd	„Zedd
„«       Zed„ «       Zedefd„«       Zedefd„«       Zedefd„«       Zedefd„«       Zed„ «       Zej.                  d„ «       Zdefd„Zd„ Z	 dddœdej                  e   dedefd„Zddefd„Z ee«      d„ «       Zy)ÚParseBaseExceptionz7base exception class for all parsing runtime exceptionsÚlocÚmsgÚpstrÚparser_elementÚargs©r   r   r   r   r   Nc                 ór   — || _         |€|| _        d| _        n|| _        || _        || _        |||f| _        y )NÚ r   )Úselfr   r   r   Úelems        r   Ú__init__zParseBaseException.__init__,   sB   € ð ˆŒØˆ;ØˆDŒHØˆD�IàˆDŒHØˆDŒIØ"ˆÔØ˜3 Ð$ˆ�	r   c                 ó<  — ddl }ddlm} |€t        j                  «       }g }t        | t        «      r?|j                  | j                  «       |j                  d| j                  dz
  z  dz   «       |j                  t        | «      j                  › d| › �«       |dkD  �rl|j                  | j                  |¬«      }t        «       }t        || d «      D �]2  \  }}|d   }	|	j                   j#                  d	d«      }
t        |
|«      r‡|	j$                  j&                  j)                  d
«      sŒZt+        |
«      |v rŒh|j-                  t+        |
«      «       t        |
«      }|j                  |j.                  › d|j                  › d|
› �«       no|
�6t        |
«      }|j                  |j.                  › d|j                  › �«       n7|	j$                  }|j&                  dv r�Œ|j                  |j&                  «       |dz  }|r�Œ3 n dj1                  |«      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Ú_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˜‹~Ðr   c                 ó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
        )r   r   r   r   )ÚclsÚpes     r   Ú_from_exceptionz"ParseBaseException._from_exception   s'   € ñ �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.
        )r   r   r   ©r   s    r   r   zParseBaseException.line‡   s   € ô
 �D—H‘H˜dŸi™iÓ(Ð(r   c                 óB   — t        | j                  | j                  «      S )zV
        Return the 1-based line number of text where the exception occurred.
        )r   r   r   rO   s    r   r   zParseBaseException.linenoŽ   s   € ô
 �d—h‘h §	¡	Ó*Ð*r   c                 óB   — t        | j                  | j                  «      S ©z]
        Return the 1-based column on the line of text where the exception occurred.
        ©r   r   r   rO   s    r   r   zParseBaseException.col•   ó   € ô
 �4—8‘8˜TŸY™YÓ'Ð'r   c                 óB   — t        | j                  | j                  «      S rR   rS   rO   s    r   r/   zParseBaseException.columnœ   rT   r   c                 ó   — | j                   S ©N©r   rO   s    r   ÚparserElementz ParseBaseException.parserElement¤   s   € à×"Ñ"Ð"r   c                 ó   — || _         y rW   rX   )r   r   s     r   rY   z ParseBaseException.parserElement¨   s
   € à"ˆÕr   c           	      óÌ  — | j                   rŸ| j                  t        | j                   «      k\  rd}n|t        j	                  | j                   | j                  «      }|�|j                  d«      }n&| j                   | j                  | j                  dz    }d|z  j                  dd«      }nd}| j                  › |› d| j                  › d	| j                  › d
| j                  › d�	S )Nz, found end of textr   r   z
, found %rz\\ú\r   z  (at char z	), (line:z, col:ú))
r   r   ÚlenÚ_exception_word_extractorÚmatchÚgroupÚreplacer   r   r/   )r   ÚfoundstrÚfound_matchÚfounds       r   Ú__str__zParseBaseException.__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Ðer   c                 ó   — t        | «      S rW   )ÚstrrO   s    r   Ú__repr__zParseBaseException.__repr__¼   s   € Ü�4‹yÐr   z>!<)ÚmarkerStringÚmarker_stringrj   c                óœ   — |�|n|}| j                   }| j                  dz
  }|rdj                  |d| |||d f«      }|j                  «       S )z‹
        Extracts the exception line from the input string, and marks
        the location of the exception with a special symbol.
        Nr   r   )r   r/   r<   Ústrip)r   rk   rj   Ú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ð �~‰~ÓÐr   c                 ó&   — | 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   )r   r>   s     r   ÚexplainzParseBaseException.explainÏ   s   € ðJ ×%Ñ% d¨EÓ2Ð2r   c                  ó   — y rW   r   rO   s    r   ÚmarkInputlinez ParseBaseException.markInputline÷   s   € Ø r   )r   NN)é   rW   )r   r   r   Ú__doc__ÚintÚ__annotations__rh   ÚtypingÚAnyÚTupleÚOptionalÚ	__slots__r   ÚstaticmethodrH   ÚclassmethodrL   Úpropertyr   r   r   r/   rY   Úsetterrf   ri   rp   rr   r   rt   r   r   r   r   r      s¤  … Ù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Ó&Ù ó 'Ù r   r   c                   ó   — e Zd ZdZy)Ú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   r   rv   r   r   r   rƒ   rƒ   ü   s   „ òr   rƒ   c                   ó   — e Zd ZdZy)ÚParseFatalExceptionzu
    User-throwable exception thrown when inconsistent parse content
    is found; stops all parsing immediately
    Nr„   r   r   r   r†   r†     s   „ òr   r†   c                   ó   — e Zd ZdZy)Ú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„   r   r   r   rˆ   rˆ     s   „ òr   rˆ   c                   ó"   — e Zd ZdZd„ Zdefd„Zy)Ú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                 ó   — || _         y rW   ©ÚparseElementTrace)r   ÚparseElementLists     r   r   z"RecursiveGrammarException.__init__'  s
   € Ø!1ˆÕr   rM   c                 ó    — d| j                   › �S )NzRecursiveGrammarException: rŒ   rO   s    r   rf   z!RecursiveGrammarException.__str__*  s   € Ø,¨T×-CÑ-CÐ,DÐEÐEr   N)r   r   r   rv   r   rh   rf   r   r   r   rŠ   rŠ      s   „ ñò2ðF˜ô Fr   rŠ   )Úrer+   ry   Úutilr   r   r   r   r   Úunicoder	   ÚppuÚLatin1ÚLatinAÚLatinBÚGreekÚCyrillicr   Ú	alphanumsÚ_extract_alphanumsÚcompiler_   Ú	Exceptionr   rƒ   r†   rˆ   rŠ   r   r   r   ú<module>r�      s»   ðó 
Û 
Û ÷õ õ .ô	˜3Ÿ:™: s§z¡z°3·:±:¸s¿y¹yÈ#Ï,É,ô 	ñ 0Ð0D×0NÑ0NÓOÐ Ø&˜BŸJ™J tÐ.@Ñ'@À<Ñ'OÓPÐ ô_!˜ô _!ôFÐ'ô ô(Ð,ô ôÐ.ô ôF 	õ Fr   