
    q"h                     :    S r SSKr " S S\5      r " S S5      rg)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-2025 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
    Nc                       \ rS rSrSrSrg)	EndOfText   zN
Raise if end of text is reached and the user
tried to call a match function.
 N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       N/var/www/html/env/lib/python3.13/site-packages/pip/_vendor/pygments/scanner.pyr   r      s    r   r   c                   l    \ rS rSrSrSS jrS r\" \\R                  5      rS rS r	S r
S rS	 rS
rg)Scanner   z`
Simple scanner

All method patterns are regular expression strings (not
compiled expressions!)
c                     Xl         [        U5      U l        SU l        SU l        X l        SU l        SU l        0 U l        g)zc
: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   s      r   __init__Scanner.__init__#   s=    
 	t9
	
r   c                 4    U R                   U R                  :  $ )z.`True` if the scanner reached the end of text.)r   r   r   s    r   eosScanner.eos1   s    xx4++++r   c                    U R                   (       a
  [        5       eXR                  ;  a-  [        R                  " XR
                  5      U R                  U'   U R                  U   R                  U R                  U R                  5      $ )zs
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   patterns     r   checkScanner.check6   s\     88+..(&(jj**&EDNN7#~~g&,,TYYAAr   c                 (    U R                  U5      SL$ )zTApply a pattern on the current position and check
if it patches. Doesn't touch pos.
N)r)   r'   s     r   testScanner.testB   s     zz'"$..r   c                    U R                   (       a
  [        5       eXR                  ;  a-  [        R                  " XR
                  5      U R                  U'   U R                  U l        U R                  U   R                  U R                  U R                  5      nUc  gUR                  5       U l        UR                  5       U l	        UR                  5       U l        g)a]  
Scan the text for the given pattern and update pos/match
and related fields. The return value is a boolean 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.
FT)r"   r   r   r%   r&   r   r   r   r   r   startr   endgroup)r   r(   ms      r   scanScanner.scanH   s     88+..(&(jj**&EDNN7#JJ	NN7#))$))TXX>9557WWY
r   c                 &    U R                  S5        g)zScan exactly one char..N)r3   r!   s    r   get_charScanner.get_char_   s    		#r   c                 b    SU R                   R                  U R                  U R                  4-  $ )Nz
<%s %d/%d>)	__class__r   r   r   r!   s    r   __repr__Scanner.__repr__c   s1    NN##HH
 
 	
r   )r   r   r   r   r   r   r   r   N)r   )r   r   r	   r
   r   r   r"   propertyr)   r,   r3   r7   r;   r   r   r   r   r   r      s=    , 3
$C
B/.
r   r   )r   r%   RuntimeErrorr   r   r   r   r   <module>r?      s'     
 M
 M
r   