a
    þd  ã                   @   s:   d dl mZ d dlmZmZ dZdZG dd„ deƒZ[dS )é    )ÚInputStream)ÚLexerActionÚLexerIndexedCustomActionNc                   @   sh   e Zd ZdZeƒ fedœdd„Zeeedœdd„ƒZ	e
dœd	d
„Zeee
dœdd„Zdd„ Zdd„ ZdS )ÚLexerActionExecutor)ÚlexerActionsÚhashCode)r   c                 C   s$   || _ td dd„ |D ƒ¡ƒ| _d S )NÚ c                 S   s   g | ]}t |ƒ‘qS © )Ústr©Ú.0Zlar	   r	   úg/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/antlr4/atn/LexerActionExecutor.pyÚ
<listcomp>   ó    z0LexerActionExecutor.__init__.<locals>.<listcomp>)r   ÚhashÚjoinr   )Úselfr   r	   r	   r   Ú__init__   s    zLexerActionExecutor.__init__)ÚlexerActionExecutorÚlexerActionc                 C   s&   | d u rt |gƒS | j|g }t |ƒS ©N)r   r   )r   r   r   r	   r	   r   Úappend-   s    
zLexerActionExecutor.append)Úoffsetc                 C   sz   d }t dt| jƒƒD ]L}| j| jrt| j| tƒs|d u rLdd„ | jD ƒ}t|| j| ƒ||< q|d u rn| S t|ƒS d S )Nr   c                 S   s   g | ]}|‘qS r	   r	   r   r	   r	   r   r   V   r   z<LexerActionExecutor.fixOffsetBeforeMatch.<locals>.<listcomp>)ÚrangeÚlenr   ÚisPositionDependentÚ
isinstancer   r   )r   r   ZupdatedLexerActionsÚir	   r	   r   ÚfixOffsetBeforeMatchQ   s    z(LexerActionExecutor.fixOffsetBeforeMatch)ÚlexerÚinputÚ
startIndexc              	   C   sŽ   d}|j }zn| jD ]T}t|tƒrH|j}| || ¡ |j}|| |k}n|jr\| |¡ d}| |¡ qW |rŠ| |¡ n|rˆ| |¡ 0 d S )NF)	Úindexr   r   r   r   ÚseekÚactionr   Úexecute)r   r   r    r!   ZrequiresSeekZ	stopIndexr   r   r	   r	   r   r%   q   s"    


ÿzLexerActionExecutor.executec                 C   s   | j S r   )r   )r   r	   r	   r   Ú__hash__ƒ   s    zLexerActionExecutor.__hash__c                 C   s6   | |u rdS t |tƒsdS | j|jko0| j|jkS d S )NTF)r   r   r   r   )r   Úotherr	   r	   r   Ú__eq__†   s    

ÿzLexerActionExecutor.__eq__N)Ú__name__Ú
__module__Ú__qualname__Ú	__slots__Úlistr   Ústaticmethodr   r   r   Úintr   ÚLexerr   r%   r&   r(   r	   r	   r	   r   r      s   # r   )Zantlr4.InputStreamr   Zantlr4.atn.LexerActionr   r   r0   r   Úobjectr	   r	   r	   r   Ú<module>   s
   y