
    kh                     @    d dl mZ d dlmZmZ dZdZ G d de      Z[y)    )InputStream)LexerActionLexerIndexedCustomActionNc                   p    e Zd ZdZ e       fdefdZededefd       Z	de
fdZd	ed
ede
fdZd Zd Zy)LexerActionExecutor)lexerActionshashCoder   c           
          || _         t        dj                  |D cg c]  }t        |       c}            | _        y c c}w )N )r   hashjoinstrr	   )selfr   las      Z/var/www/teggl/fontify/venv/lib/python3.12/site-packages/antlr4/atn/LexerActionExecutor.py__init__zLexerActionExecutor.__init__   s3    ( RWW%E"c"g%EFG%Es   ?lexerActionExecutorlexerActionc                 T    | t        |g      S | j                  |gz   }t        |      S N)r   r   )r   r   r   s      r   appendzLexerActionExecutor.append-   s2    &&77*77K/I"<00    offsetc                 T   d }t        dt        | j                              D ]q  }| j                  |   j                  st	        | j                  |   t
              r;|| j                  D cg c]  }| }}t        || j                  |         ||<   s || S t        |      S c c}w )Nr   )rangelenr   isPositionDependent
isinstancer   r   )r   r   updatedLexerActionsir   s        r   fixOffsetBeforeMatchz(LexerActionExecutor.fixOffsetBeforeMatchQ   s    "q#d//01 	`A  #77
4K\K\]^K_ay@z&.9=9J9J*L2B*L'*L)A&$J[J[\]J^)_#A&		` &K&':;; +Ms   -	B%lexerinput
startIndexc                    d}|j                   }	 | j                  D ]w  }t        |t              r5|j                  }|j                  ||z          |j                  }||z   |k7  }n|j                  r|j                  |       d}|j                  |       y 	 |r|j                  |       y y # |r|j                  |       w w xY w)NF)	indexr   r   r   r   seekactionr   execute)r   r"   r#   r$   requiresSeek	stopIndexr   r   s           r   r)   zLexerActionExecutor.executeq   s    KK		&#00 	+k+CD(//FJJzF23"-"4"4K$.$7I#EL 44JJy)#(L##E*	+ 

9% |

9% s   BB, ,Cc                     | j                   S r   )r	   )r   s    r   __hash__zLexerActionExecutor.__hash__   s    }}r   c                     | |u ryt        |t              sy| j                  |j                  k(  xr | j                  |j                  k(  S )NTF)r   r   r	   r   )r   others     r   __eq__zLexerActionExecutor.__eq__   sH    5=E#67==ENN2 <%%););;<r   N)__name__
__module____qualname__	__slots__listr   staticmethodr   r   r   intr!   Lexerr   r)   r-   r0    r   r   r   r      so    ,I)- HD H( 1#6 1[ 1 1F<# <@&E & & &$<r   r   )antlr4.InputStreamr   antlr4.atn.LexerActionr   r   r8   r   objectr9   r   r   <module>r=      s.    + H 	 w<& w<r 
r   