Ë
    ðeœiä  ã                   ó�   — d Z ddlmZmZ ddlmZmZ ddlmZ ddl	m
Z
 ddlmZ  G d„ d	e«      Z G d
„ de
e«      Z G d„ de«      Zy)z@Provides a post-lexer for implementing Python-style indentation.é    )ÚABCÚabstractmethod)ÚListÚIteratoré   )Ú	LarkError)ÚPostLex)ÚTokenc                   ó   — e Zd Zy)ÚDedentErrorN)Ú__name__Ú
__module__Ú__qualname__© ó    úb/var/www/html/Whatsapp_Customer_Support_Chatbot/venv/lib/python3.12/site-packages/lark/indenter.pyr   r      s   „ Ør   r   c                   ó2  — e Zd ZU dZeed<   ee   ed<   dd„Zdede	e   fd„Z
d	„ Zd
„ Zed„ «       Zeedefd„«       «       Zeedee   fd„«       «       Zeedee   fd„«       «       Zeedefd„«       «       Zeedefd„«       «       Zeedefd„«       «       Zy)ÚIndentera  This is a postlexer that "injects" indent/dedent tokens based on indentation.

    It keeps track of the current indentation, as well as the current level of parentheses.
    Inside parentheses, the indentation is ignored, and no indent/dedent tokens get generated.

    Note: This is an abstract class. To use it, inherit and implement all its abstract methods:
        - tab_len
        - NL_type
        - OPEN_PAREN_types, CLOSE_PAREN_types
        - INDENT_type, DEDENT_type

    See also: the ``postlex`` option in `Lark`.
    Úparen_levelÚindent_levelÚreturnNc                 óD   — d| _         dg| _        | j                  dkD  sJ ‚y ©Nr   )r   r   Útab_len©Úselfs    r   Ú__init__zIndenter.__init__    s&   € ØˆÔØ˜CˆÔØ�|‰|˜aÒÐÑr   Útokenc              #   ó„  K  — | j                   dkD  ry |–— |j                  dd«      d   }|j                  d«      |j                  d«      | j                  z  z   }|| j                  d   kD  r?| j                  j                  |«       t        j                  | j                  ||«      –— y || j                  d   k  rP| j                  j                  «        t        j                  | j                  ||«      –— || j                  d   k  rŒP|| j                  d   k7  rt        d|›d| j                  d   ›�«      ‚y ­w)	Nr   ú
r   ú ú	éÿÿÿÿzUnexpected dedent to column z. Expected dedent to )r   ÚrsplitÚcountr   r   Úappendr
   Únew_borrow_posÚINDENT_typeÚpopÚDEDENT_typer   )r   r   Ú
indent_strÚindents       r   Ú	handle_NLzIndenter.handle_NL%   s)  è ø€ Ø×Ñ˜aÒØàŠà—\‘\ $¨Ó*¨1Ñ-ˆ
Ø×!Ñ! #Ó&¨×)9Ñ)9¸$Ó)?À$Ç,Á,Ñ)NÑNˆà�D×%Ñ% bÑ)Ò)Ø×Ñ×$Ñ$ VÔ,Ü×&Ñ& t×'7Ñ'7¸ÀUÓKÓKà˜4×,Ñ,¨RÑ0Ò0Ø×!Ñ!×%Ñ%Ô'Ü×*Ñ*¨4×+;Ñ+;¸ZÈÓOÒOð ˜4×,Ñ,¨RÑ0Ó0ð ˜×*Ñ*¨2Ñ.Ò.Ý!Ò]cÐei×evÑevÐwyÒezÐ"{Ó|Ð|ð /ùs   ‚DE Ä1E c           
   #   óÆ  K  — d }|D ]¦  }|j                   | j                  k(  r| j                  |«      E d {  –—†  n|–— |j                   | j                  v r| xj                  dz  c_        Œh|j                   | j
                  v sŒ�| xj                  dz  c_        | j                  dk\  rŒ¦J ‚ t        | j                  «      dkD  rt| j                  j                  «        |r!t        j                  | j                  d|«      nt        | j                  ddddddd«      –— t        | j                  «      dkD  rŒt| j                  dgk(  sJ | j                  «       ‚y 7 �Œ'­w)Nr   r   Ú )ÚtypeÚNL_typer-   ÚOPEN_PAREN_typesr   ÚCLOSE_PAREN_typesÚlenr   r)   r
   r'   r*   )r   Ústreamr   s      r   Ú_processzIndenter._process9   s@  è ø€ ØˆØò 
	-ˆEØ�z‰z˜TŸ\™\Ò)ØŸ>™>¨%Ó0×0Ñ0à’à�z‰z˜T×2Ñ2Ñ2Ø× Ò  AÑ%Ö Ø—‘˜t×5Ñ5Ò5Ø× Ò  AÑ%Õ Ø×'Ñ'¨1Ó,Ð,Ð,ð
	-ô �$×#Ñ#Ó$ qÒ(Ø×Ñ×!Ñ!Ô#ÙGL”%×&Ñ& t×'7Ñ'7¸¸UÔCÔRWÐX\×XhÑXhÐjlÐnoÐqrÐtuÐwxÐz{Ð}~ÓRÒô �$×#Ñ#Ó$ qÓ(ð × Ñ  Q CÒ'Ð:¨×):Ñ):Ó:Ñ'ð 1ûs#   ‚5E!·E¸AE!Â$E!Â-BE!Ä<#E!c                 óB   — d| _         dg| _        | j                  |«      S r   )r   r   r6   )r   r5   s     r   ÚprocesszIndenter.processM   s#   € ØˆÔØ˜CˆÔØ�}‰}˜VÓ$Ð$r   c                 ó   — | j                   fS )N)r1   r   s    r   Úalways_acceptzIndenter.always_acceptS   s   € à—‘ˆÐr   c                 ó   — t        «       ‚)zThe name of the newline token©ÚNotImplementedErrorr   s    r   r1   zIndenter.NL_typeW   ó   € ô "Ó#Ð#r   c                 ó   — t        «       ‚)z/The names of the tokens that open a parenthesisr<   r   s    r   r2   zIndenter.OPEN_PAREN_types]   r>   r   c                 ó   — t        «       ‚)z9The names of the tokens that close a parenthesis
        r<   r   s    r   r3   zIndenter.CLOSE_PAREN_typesc   s   € ô
 "Ó#Ð#r   c                 ó   — t        «       ‚)zeThe name of the token that starts an indentation in the grammar.

        See also: %declare
        r<   r   s    r   r(   zIndenter.INDENT_typej   ó   € ô "Ó#Ð#r   c                 ó   — t        «       ‚)zbThe name of the token that end an indentation in the grammar.

        See also: %declare
        r<   r   s    r   r*   zIndenter.DEDENT_types   rB   r   c                 ó   — t        «       ‚)z How many spaces does a tab equalr<   r   s    r   r   zIndenter.tab_len|   r>   r   )r   N)r   r   r   Ú__doc__ÚintÚ__annotations__r   r   r
   r   r-   r6   r8   Úpropertyr:   r   Ústrr1   r2   r3   r(   r*   r   r   r   r   r   r      s0  … ñð ÓØ�s‘)Óó ð
}˜uð }¨°%©ó }ò(;ò(%ð ñó ðð Øð$˜ò $ó ó ð$ð Øð$ $ s¡)ò $ó ó ð$ð Øð$ 4¨¡9ò $ó ó ð$ð
 Øð$˜Sò $ó ó ð$ð Øð$˜Sò $ó ó ð$ð Øð$˜ò $ó ó ñ$r   r   c                   ó0   — e Zd ZdZdZg d¢Zg d¢ZdZdZdZ	y)	ÚPythonIndenterz�A postlexer that "injects" _INDENT/_DEDENT tokens based on indentation, according to the Python syntax.

    See also: the ``postlex`` option in `Lark`.
    Ú_NEWLINE)ÚLPARÚLSQBÚLBRACE)ÚRPARÚRSQBÚRBRACEÚ_INDENTÚ_DEDENTé   N)
r   r   r   rE   r1   r2   r3   r(   r*   r   r   r   r   rK   rK   ƒ   s)   „ ñð
 €GÚ1ÐÚ2ÐØ€KØ€KØ�Gr   rK   N)rE   Úabcr   r   Útypingr   r   Ú
exceptionsr   Úlarkr	   Úlexerr
   r   r   rK   r   r   r   ú<module>r[      s@   ðÙ Bç #ß !å !Ý Ý ô	�)ô 	ôq$ˆw˜ô q$ôh�Xõ r   