o
    ™Mf  ã                   @   s.   d Z ddlZG dd„ deƒZG dd„ dƒZdS )a  
    pygments.scanner
    ~~~~~~~~~~~~~~~~

    This library implements a regex based scanner. Some languages
    like Pascal are easy to parse but have some keywords that
    depend on the context. Because of this it's impossible to lex
    that just by using a regular expression lexer like the
    `RegexLexer`.

    Have a look at the `DelphiLexer` to get an idea of how to use
    this scanner.

    :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    Nc                   @   s   e Zd ZdZdS )Ú	EndOfTextzZ
    Raise if end of text is reached and the user
    tried to call a match function.
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   ú^/var/www/html/analyze/labelStudio/lib/python3.10/site-packages/pip/_vendor/pygments/scanner.pyr      s    r   c                   @   sV   e Zd ZdZddd„Zdd„ ZeeejƒZdd„ Zd	d
„ Zdd„ Z	dd„ Z
dd„ ZdS )ÚScannerzp
    Simple scanner

    All method patterns are regular expression strings (not
    compiled expressions!)
    r   c                 C   s8   || _ t|ƒ| _d| _d| _|| _d| _d| _i | _dS )z{
        :param text:    The text which should be scanned
        :param flags:   default regular expression flags
        r   N)	ÚdataÚlenÚdata_lengthÚ	start_posÚposÚflagsÚlastÚmatchÚ	_re_cache)ÚselfÚtextr   r   r   r   Ú__init__#   s   

zScanner.__init__c                 C   s   | j | jkS )z.`True` if the scanner reached the end of text.)r   r   ©r   r   r   r   Úeos1   s   zScanner.eosc                 C   s@   | j rtƒ ‚|| jvrt || j¡| j|< | j|  | j| j¡S )z“
        Apply `pattern` on the current position and return
        the match object. (Doesn't touch pos). Use this for
        lookahead.
        )	r   r   r   ÚreÚcompiler   r   r
   r   ©r   Úpatternr   r   r   Úcheck6   s
   
zScanner.checkc                 C   s   |   |¡duS )zdApply a pattern on the current position and check
        if it patches. Doesn't touch pos.
        N)r   r   r   r   r   ÚtestB   s   zScanner.testc                 C   sv   | j rtƒ ‚|| jvrt || j¡| j|< | j| _| j|  | j| j	¡}|du r*dS | 
¡ | _| ¡ | _	| ¡ | _dS )aœ  
        Scan the text for the given pattern and update pos/match
        and related fields. The return value is a boolen that
        indicates if the pattern matched. The matched value is
        stored on the instance as ``match``, the last value is
        stored as ``last``. ``start_pos`` is the position of the
        pointer before the pattern was matched, ``pos`` is the
        end position.
        NFT)r   r   r   r   r   r   r   r   r
   r   Ústartr   ÚendÚgroup)r   r   Úmr   r   r   ÚscanH   s   




zScanner.scanc                 C   s   |   d¡ dS )zScan exactly one char.Ú.N)r"   r   r   r   r   Úget_char_   s   zScanner.get_charc                 C   s   d| j j| j| jf S )Nz
<%s %d/%d>)Ú	__class__r   r   r   r   r   r   r   Ú__repr__c   s
   ýzScanner.__repr__N)r   )r   r   r   r   r   r   Úpropertyr   r   r"   r$   r&   r   r   r   r   r	      s    
r	   )r   r   ÚRuntimeErrorr   r	   r   r   r   r   Ú<module>   s    