ó
    ÖÁ“iŒ*  ã                   óš  • S SK JrJr  SSKJrJrJrJrJrJ	r	J
r
JrJrJrJrJr  \(       a  S SKJr  S SKJr  S SKJr   " S S\5      r " S	 S
\\5      rS!S\4S jjr " S S\5      r " S S\5      r " S S\5      r\" S5      r " 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 )"é   )ÚloggerÚNO_VALUEé    )ÚMappingÚIterableÚCallableÚUnionÚTypeVarÚTupleÚAnyÚListÚSetÚOptionalÚ
CollectionÚTYPE_CHECKING©ÚToken)ÚInteractiveParser)ÚTreec                   ó   • \ rS rSrSrg)Ú	LarkErroré   © N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r   ó    ÚL/home/mande/repo/quber/.venv/lib/python3.13/site-packages/lark/exceptions.pyr   r      ó   † Úr    r   c                   ó   • \ rS rSrSrg)ÚConfigurationErroré   r   Nr   r   r    r!   r$   r$      r"   r    r$   Úoptionsc                 ó,   • X;  a  [        X U4-  5      eg ©N)r$   )Úvaluer&   Úmsgs      r!   Úassert_configr+      s    € ØÓÜ  ¨wÐ'7Ñ!7Ó8Ð8ð r    c                   ó   • \ rS rSrSrg)ÚGrammarErroré   r   Nr   r   r    r!   r-   r-      r"   r    r-   c                   ó   • \ rS rSrSrg)Ú
ParseErroré   r   Nr   r   r    r!   r0   r0      r"   r    r0   c                   ó   • \ rS rSrSrg)ÚLexErroré    r   Nr   r   r    r!   r3   r3       r"   r    r3   ÚTc                   óÆ   • \ rS rSr% Sr\\S'   \\S'   Sr\\S'   Sr	S\S'   SS	\
S
\S\
4S jjr  SSSS\\\\\
   4   \\\\\
   4      4   S\S\S\\   4
S jjrS rSrg)ÚUnexpectedInputé%   aŒ  UnexpectedInput Error.

Used as a base class for the following exceptions:

- ``UnexpectedCharacters``: The lexer encountered an unexpected string
- ``UnexpectedToken``: The parser received an unexpected token
- ``UnexpectedEOF``: The parser expected a token, but the input ended

After catching one of these exceptions, you may call the following helper methods to create a nicer error message.
ÚlineÚcolumnNÚstater   Úinteractive_parserÚtextÚspanÚreturnc                 óî  • U R                   =(       d    Sn[        X2-
  S5      nX2-   n[        U[        5      (       dU  XU R	                  SS5      S   nXU R                  SS5      S   nXg-   S-   S[        UR                  5       5      -  -   S-   $ XU R	                  SS5      S   nXU R                  SS5      S   nXg-   S-   S[        UR                  5       5      -  -   S	-   R                  S
S5      $ )zØReturns a pretty string pinpointing the error in the text,
with span amount of context characters around it.

Note:
    The parser doesn't hold a copy of the text it has to parse,
    so you have to provide it again
r   Ú
r   éÿÿÿÿÚ z^
ó   
ó    s   ^
ÚasciiÚbackslashreplace)	Úpos_in_streamÚmaxÚ
isinstanceÚbytesÚrsplitÚsplitÚlenÚ
expandtabsÚdecode)Úselfr=   r>   ÚposÚstartÚendÚbeforeÚafters           r!   Úget_contextÚUnexpectedInput.get_context7   s  € ð × Ñ ×% AˆÜ�C‘J Ó"ˆØ‰jˆÜ˜$¤×&Ñ&Ø �_×+Ñ+¨D°!Ó4°RÑ8ˆFØ˜S�M×'Ñ'¨¨aÓ0°Ñ3ˆEØ‘> DÑ(¨3´°V×5FÑ5FÓ5HÓ1IÑ+IÑIÈEÑQÐQà �_×+Ñ+¨E°1Ó5°bÑ9ˆFØ˜S�M×'Ñ'¨¨qÓ1°!Ñ4ˆEØ‘N UÑ*¨T´C¸×8IÑ8IÓ8KÓ4LÑ-LÑLÈvÑU×]Ñ]Ð^eÐgyÓzÐzr    Úparse_fnzCallable[[str], Tree]ÚexamplesÚtoken_type_match_fallbackÚuse_acceptsc                 óÊ  • U R                   c   S5       e[        U[        5      (       a  UR                  5       nSn[	        U5       HA  u  nu  px[        U[
        5      (       a   S5       e[	        U5       H  u  pš U" U
5        M     MC     US   $ ! [         GaÆ  nUR                   U R                   :X  GaŸ  U(       a…  [        U [        5      (       ap  [        U[        5      (       a[  UR                  U R                  :w  aA  [        R                  " SU R                   U R                  UR                  Xi4-  5         SnAMÍ  [        U [        [        45      (       aÁ  [        U[        [        45      (       a¦  UR                  U R                  :X  a*  [        R                  " SU< SU	< S35        Us SnAs  s  $ U(       a[  UR                  R                  U R                  R                  :X  a-  US	   (       d#  [        R                  " S
U< SU	< S35        US4nUS   c*  [        R                  " SU< SU	< S35        US4n SnAGMÙ   SnAGMà   SnAGMç  SnAff = f)a}  Allows you to detect what's wrong in the input text by matching
against example errors.

Given a parser instance and a dictionary mapping some label with
some malformed syntax examples, it'll return the label for the
example that bests matches the current error. The function will
iterate the dictionary until it finds a matching error, and
return the corresponding value.

For an example usage, see `examples/error_reporting_lalr.py`

Parameters:
    parse_fn: parse function (usually ``lark_instance.parse``)
    examples: dictionary of ``{'example_string': value}``.
    use_accepts: Recommended to keep this as ``use_accepts=True``.
Nz Not supported for this exception)NFzExpecting a listzCDifferent accepts with same state[%d]: %s != %s at example [%s][%s]zExact Match at example [z][Ú]rB   z Token Type Fallback at example [Tr   zSame State match at example [F)r;   rJ   r   ÚitemsÚ	enumerateÚstrr7   ÚUnexpectedTokenÚacceptsr   ÚdebugÚUnexpectedEOFÚtokenÚtype)rQ   rY   rZ   r[   r\   Ú	candidateÚiÚlabelÚexampleÚjÚ	malformedÚuts               r!   Úmatch_examplesÚUnexpectedInput.match_examplesK   sÐ  € ð* �z‰zÑ%ÐIÐ'IÓIÐ%ä�h¤×(Ñ(Ø—~‘~Ó'ˆHà!ˆ	Ü#,¨XÖ#6ÑˆAÑ�Ü! '¬3×/Ñ/ÐCÐ1CÓCÐ/ä )¨'Ö 2‘�ð5Ù˜YÖ'ó !3ñ $7ðF ˜‰|Ðøô; 'ô 5Ø—x‘x 4§:¡:Ô-æ'Ü *¨4´× AÑ AÜ *¨2¬× ?Ñ ?Ø "§
¡
¨d¯l©lÓ :ä"ŸLšLÐ)nØ*.¯*©*°d·l±lÀBÇJÁJÐPQÐ)Uñ*Vô Wå$ä& t¬o¼}Ð-M×NÑNÜ *¨2´ÄÐ/O× PÑ Pà!Ÿx™x¨4¯:©:Ó5Ü &§£ÓRSÓUVÐ-WÔ XØ',§¡æ8à$&§H¡H§M¡M°T·Z±Z·_±_Ó$DÈiÐXZÏmÜ$*§L£LÓ^_ÓabÐ1cÔ$dØ05°t° Ià$ Q™<Ñ/Ü"ŸL›LÓSTÓVWÐ)XÔYØ(-¨u¨ŸIö 0ö1 .ûð5ús-   Á<BÂI"ÂB!IÅA0IÆ3I"Æ=BIÉI"c                 óÀ   • U R                   (       a5  U R                   nU Vs/ s H  o3U;   a  X#   R                  5       OUPM     nnSSR                  U5      -  $ s  snf )NzExpected one of: 
	* %s
z
	* )Ú_terminals_by_nameÚ	user_reprÚjoin)rQ   ÚexpectedÚdÚt_names       r!   Ú_format_expectedÚ UnexpectedInput._format_expected‹   sZ   € Ø×"×"Ø×'Ñ'ˆAÙW_Ó`ÒW_ÈV¸1³˜™	×+Ñ+Ô-À&ÒHÑW_ˆHÐ`Ø,¨x¯}©}¸XÓ/FÑFÐFùò as   ¢#Ar   )é(   )FT)r   r   r   r   Ú__doc__ÚintÚ__annotations__rH   r   rr   ra   rW   r	   r   r5   r   r   Úboolr   ro   rx   r   r   r    r!   r7   r7   %   s¼   ‡ ñ	ð ƒIØƒKØ€MØƒJØÐØ+Ó+ñ{ ð {¨3ð {°cõ {ð, >CØ/3ñ>Ð'>ð >Ø',¨W°Q¸À¹Ð5EÑ-FÈÐQVÐWXÐZbÐcfÑZgÐWgÑQhÑHiÐ-iÑ'jð>à8<ð>ð +/ð>ð ' q™kõ	>õ@Gr    r7   c                   óB   ^ • \ rS rSr% SrS\S'   SU 4S jjrS rSrU =r	$ )	re   é’   zcAn exception that is raised by the parser, when the input ends while it still expects a token.
    zList[Token]ru   c                 ó    >• [         [        U ]  5         Xl        X l        SSKJn  U" SS5      U l        SU l        SU l	        SU l
        X0l        g )Nr   r   z<EOF>Ú rB   )Úsuperre   Ú__init__ru   r;   Úlexerr   rf   rH   r9   r:   rr   )rQ   ru   r;   Úterminals_by_namer   Ú	__class__s        €r!   r„   ÚUnexpectedEOF.__init__—   sG   ø€ ÜŒm˜TÑ+Ô-à ŒØŒ
Ý Ù˜7 BÓ'ˆŒ
ØˆÔØˆŒ	ØˆŒØ"3Õr    c                 óD   • SnXR                  U R                  5      -  nU$ )NzUnexpected end-of-input. )rx   ru   ©rQ   Úmessages     r!   Ú__str__ÚUnexpectedEOF.__str__¤   s#   € Ø-ˆØ×(Ñ(¨¯©Ó7Ñ7ˆØˆr    )rr   r:   ru   r9   rH   r;   rf   )NN)
r   r   r   r   r{   r}   r„   rŒ   r   Ú__classcell__©r‡   s   @r!   re   re   ’   s   ø‡ ñàÓ÷
4÷ð r    re   c                   ó\   ^ • \ rS rSr% Sr\\   \S'   \\   \S'     SU 4S jjr	S r
SrU =r$ )	ÚUnexpectedCharacterséª   zvAn exception that is raised by the lexer, when it cannot match the next
string of characters to any of its terminals.
ÚallowedÚconsidered_tokensc                 ó8  >• [         [        U ]  5         X0l        X@l        X l        Xpl        X�l        XPl        X`l	        X l
        X€l        [        U[        5      (       a  XUS-    R                  SS5      U l        O	X   U l        U R!                  U5      U l        g )Nr   rF   rG   )rƒ   r‘   r„   r9   r:   rH   r;   rr   r“   r”   Úconsidered_rulesÚtoken_historyrJ   rK   rP   ÚcharrW   Ú_context)rQ   ÚseqÚlex_posr9   r:   r“   r”   r;   r—   r†   r–   r‡   s              €r!   r„   ÚUnexpectedCharacters.__init__²   s‹   ø€ äÔ" DÑ2Ô4ð Œ	ØŒØ$ÔØŒ
Ø"3ÔàŒØ!2ÔØ 0ÔØ*Ôä�cœ5×!Ñ!Ø G¨a¡KÐ0×7Ñ7¸ÐASÓTˆD�Ià™ˆDŒIØ×(Ñ(¨Ó-ˆ�r    c                 óD  • SU R                   U R                  U R                  4-  nUSU R                  -   -  nU R                  (       a  XR                  U R                  5      -  nU R                  (       a(  USSR                  S U R                   5       5      -  -  nU$ )NzINo terminal matches '%s' in the current parser context, at line %d col %dz

z
Previous tokens: %s
z, c              3   ó8   #   • U  H  n[        U5      v •  M     g 7fr(   )Úrepr)Ú.0Úts     r!   Ú	<genexpr>Ú/UnexpectedCharacters.__str__.<locals>.<genexpr>Ï   s   é € Ð<aÒN`È¼TÀ!¿W¸WÒN`ùs   ‚)r˜   r9   r:   r™   r“   rx   r—   rt   rŠ   s     r!   rŒ   ÚUnexpectedCharacters.__str__É   s›   € Ø]Ðae×ajÑajÐlp×luÑluÐw{÷  xCñ  xCð  aDñ  DˆØ�6˜DŸM™MÑ)Ñ)ˆØ�<�<Ø×,Ñ,¨T¯\©\Ó:Ñ:ˆGØ××ØÐ0°4·9±9Ñ<aÈd×N`ÒN`Ó<aÓ3aÑaÑaˆGØˆr    )r™   rr   r“   r˜   r:   r–   r”   r9   rH   r;   r—   )NNNNNN)r   r   r   r   r{   r   ra   r}   r   r„   rŒ   r   rŽ   r�   s   @r!   r‘   r‘   ª   s3   ø‡ ñð �‰XÓØ˜3‘xÓàswØ:>÷.÷.ð r    r‘   c                   óv   ^ • \ rS rSr% Sr\\   \S'   \\   \S'   S
U 4S jjr\	S\\   4S j5       r
S rS	rU =r$ )rb   éÓ   aa  An exception that is raised by the parser, when the token it received
doesn't match any valid step forward.

Parameters:
    token: The mismatched token
    expected: The set of expected tokens
    considered_rules: Which rules were considered, to deduce the expected tokens
    state: A value representing the parser state. Do not rely on its value or type.
    interactive_parser: An instance of ``InteractiveParser``, that is initialized to the point of failure,
                        and can be used for debugging and error handling.

Note: These parameters are available as attributes of the instance.
ru   r–   c                 ó   >• [         [        U ]  5         [        USS5      U l        [        USS5      U l        [        USS 5      U l        X@l        Xl        X l	        [        U l        X0l        XPl        X`l        Xpl        g )Nr9   Ú?r:   Ú	start_pos)rƒ   rb   r„   Úgetattrr9   r:   rH   r;   rf   ru   r   Ú_acceptsr–   r<   rr   r—   )	rQ   rf   ru   r–   r;   r<   r†   r—   r‡   s	           €r!   r„   ÚUnexpectedToken.__init__å   sq   ø€ ÜŒo˜tÑ-Ô/ô ˜E 6¨3Ó/ˆŒ	Ü˜e X¨sÓ3ˆŒÜ$ U¨K¸Ó>ˆÔØŒ
àŒ
Ø ŒÜ ˆŒØ 0ÔØ"4ÔØ"3ÔØ*Õr    r?   c                 ó¤   • U R                   [        L a2  U R                  =(       a    U R                  R                  5       U l         U R                   $ r(   )r«   r   r<   rc   )rQ   s    r!   rc   ÚUnexpectedToken.accepts÷   s9   € à�=‰=œHÒ$Ø ×3Ñ3×Y¸×8OÑ8O×8WÑ8WÓ8YˆDŒMØ�}‰}Ðr    c                 ó  • SU R                   < SU R                  < SU R                  < SU R                  U R                  =(       d    U R
                  5      < 3nU R                  (       a  USU R                  -  -  nU$ )NzUnexpected token z	 at line z	, column z.
zPrevious tokens: %r
)rf   r9   r:   rx   rc   ru   r—   rŠ   s     r!   rŒ   ÚUnexpectedToken.__str__ý   sa   � à—j”j $§)¤)¨T¯[¬[¸$×:OÑ:OÐPT×P\ÑP\×PmÐ`d×`mÑ`mÕ:nðpˆà××ØÐ.°×1CÑ1CÑCÑCˆGàˆr    )r«   rr   r:   r–   ru   r<   r9   rH   r;   rf   r—   )NNNNN)r   r   r   r   r{   r   ra   r}   r„   Úpropertyrc   rŒ   r   rŽ   r�   s   @r!   rb   rb   Ó   sL   ø‡ ñð �#‰hÓØ˜#‘hÓ÷+ð$ ð˜˜S™ó ó ð÷
ð r    rb   c                   óB   ^ • \ rS rSr% SrS\S'   \\S'   U 4S jrSrU =r	$ )Ú
VisitErrori  aV  VisitError is raised when visitors are interrupted by an exception

It provides the following attributes for inspection:

Parameters:
    rule: the name of the visit rule that failed
    obj: the tree-node or token that was being processed
    orig_exc: the exception that cause it to fail

Note: These parameters are available as attributes
zUnion[Tree, Token]ÚobjÚorig_excc                 ód   >• SU< SU< 3n[         [        U ]  U5        Xl        X l        X0l        g )NzError trying to process rule "z":

)rƒ   r³   r„   Úruler´   rµ   )rQ   r·   r´   rµ   r‹   r‡   s        €r!   r„   ÚVisitError.__init__  s+   ø� Û@DÂhÐOˆÜŒj˜$Ñ(¨Ô1àŒ	ØŒØ �r    )r´   rµ   r·   )
r   r   r   r   r{   r}   Ú	Exceptionr„   r   rŽ   r�   s   @r!   r³   r³     s    ø‡ ñ
ð 
ÓØÓ÷!ó !r    r³   c                   ó   • \ rS rSrSrg)ÚMissingVariableErrori   r   Nr   r   r    r!   r»   r»      r"   r    r»   N)zGot %r, expected one of %s)%Úutilsr   r   Útypingr   r   r   r	   r
   r   r   r   r   r   r   r   r…   r   Úparsers.lalr_interactive_parserr   Útreer   r¹   r   Ú
ValueErrorr$   r+   r-   r0   r3   r5   r7   re   r‘   rb   r³   r»   r   r    r!   Ú<module>rÁ      sÊ   ðß #ß z× z× zÓ zæÝÝBÝô	�	ô 	ô	˜ Jô 	ñ9 *õ 9ô
	�9ô 	ô	�ô 	ô	ˆyô 	ñ ˆCƒL€ôjG�iô jGôZ�J ô ô0&˜8 _ô &ôR0�j /ô 0ôh!�ô !ô2	˜9õ 	r    