
    MhP                         d Z ddlZddlmZ ddlmZmZmZmZmZm	Z	 ddl
mZ ddlmZmZmZmZmZmZmZmZmZ g dZ G d d	e          Z G d
 de          Z G d de          ZdS )z
    pygments.lexers.textedit
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for languages related to text processing.

    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)bisect)
RegexLexerbygroupsdefaultincludethisusing)PythonLexer)	CommentKeywordNameNumberOperatorPunctuationStringText
Whitespace)AwkLexerSedLexerVimLexerc                   l   e Zd ZdZdZg dZdgZdgZdZdZ	de
fd	ej        fg ed
          dej        dfde
df ed          gde
dfgde
df ed
          dedfdedfdefdedfdej        dfdej        fdej        fdej        fdej        fdej        fdej        fdej        fdej        fgdZd S )!r   z
    For Awk scripts.
    Awk)awkgawkmawknawkz*.awkzapplication/x-awkz!https://en.wikipedia.org/wiki/AWKz1.5\s+#.*$commentsandwhitespacez(/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/\B#popz(?=/))r    badregexz\nz	^(?=\s|/)slashstartsregexz8\+\+|--|\|\||&&|in\b|\$|!?~|\?|:|(\*\*|[-<>+*%\^/!=|])=?z[{(\[;,]z[})\].]z3(break|continue|do|while|exit|for|if|else|return)\bz
function\bz(atan2|cos|exp|int|log|rand|sin|sqrt|srand|gensub|gsub|index|length|match|split|sprintf|sub|substr|tolower|toupper|close|fflush|getline|next|nextfile|print|printf|strftime|systime|delete|system)\bz(ARGC|ARGIND|ARGV|BEGIN|CONVFMT|ENVIRON|END|ERRNO|FIELDWIDTHS|FILENAME|FNR|FS|IGNORECASE|NF|NR|OFMT|OFS|ORFS|RLENGTH|RS|RSTART|RT|SUBSEP)\bz[$a-zA-Z_]\w*z%[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?z0x[0-9a-fA-F]+[0-9]+z"(\\\\|\\[^\\]|[^"\\])*"z'(\\\\|\\[^\\]|[^'\\])*')r   r"   r!   rootN)__name__
__module____qualname____doc__namealiases	filenames	mimetypesurlversion_addedr   r   Singler   r   Regexr   r   r   r   DeclarationReservedr   BuiltinOtherr   FloatHexIntegerDoubletokens     X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pygments/lexers/textedit.pyr   r      su         D---G	I$%I
-CM TNgn%"

 G+,,L&*t12GFOO
 D&!
 4!34G+,,()13EG+'9:%"$68G/1CD! #*"24$%)\3 tz*5v|D
+'(&-8(&-8-
' 'FFFr;   r   c                      e Zd ZdZdZg dZddgZdgZdZdZ	e
j        Zd	Zd
defdej        fdej        fdefdefdefd eeej                  fd eeej                  fd eeej                  fdez   dz    eeej        e          fdez   dz    eedej        e          fdez   dz   ez   dz    eeeej        eej        e          fdez   dz   ez   dz    eeeej        eej        ee          fgiZdS )r   z%
    Lexer for Sed script files.
    Sed)sedgsedssedz*.sedz	*.[gs]sedz
text/x-sedz!https://en.wikipedia.org/wiki/Sed z.((?:(?:\\[^\n]|[^\\])*?\\\n)*?(?:\\.|[^\\])*?)r$   r   r   r#   z\$z[{};,!]z[dDFgGhHlnNpPqQxz=]z([berRtTvwW:])([^;\n]*)z"([aci])((?:.*?\\\n)*(?:.*?[^\\]$))z([qQ])([0-9]*)z(/)z(\\(.))z(\2)Nz(y)(.)z(s)(.)z(\2)((?:[gpeIiMm]|[0-9])*))r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   re	MULTILINEflags_inside_delimsr   r   r/   r   r7   r   r   r   r   r   r8   r0   r9   r:   r;   r<   r   r   L   s         D%%%G+&II
-CMLE GN 	Z gn%'H%#W-''6=)I)IJ2HHWfm4T4TU&. A ABn$v-xxV\S^/_/_`.(72Xk4{CCE''1NBWLXg{FM;Wbcce''1NBEbbXg{FL+v}Va  
FFFr;   r   c                      e Zd ZdZdZdgZg dZdgZdZdZ	e
j        ZdZd	d
ez   dz    e ee          eeeee ee          e          fd
ez   dz    e ee          ee ee                    fdefdefdej        fdej        fdej        fdefdefdej        fdefdefdefdej        fdej        fdefgiZ d Z!d Z"d Z#dS )r   z&
    Lexer for VimL script files.
    VimLvim)	z*.vimz.vimrcz.exrcz.gvimrc_vimrc_exrc_gvimrcvimrcgvimrcz
text/x-vimzhttps://www.vim.orgz0.8zpy(?:t(?:h(?:o(?:n)?)?)?)?r$   z^([ \t:]*)(z()([ \t]*)(<<)([ \t]*)(.*)((?:\n|.)*)(\6)z)([ \t])(.*)z^\s*".*z[ \t]+z!/[^/\\\n]*(?:\\[\s\S][^/\\\n]*)*/z!"[^"\\\n]*(?:\\[\s\S][^"\\\n]*)*"z'[^\n']*(?:''[^\n']*)*'z(?<=\s)"[^\-:.%#=*].*z-?\d+z#[0-9a-f]{6}z^:z[()<>+=!|,~-]z7\b(let|if|else|endif|elseif|fun|function|endfunction)\bz+\b(NONE|bold|italic|underline|dark|light)\bz\b\w+\b.c                 h    ddl m}m}m} || _        || _        || _        t          j        | fi | d S )Nr   )autocommandoption)	pygments.lexers._vim_builtinsrQ   rR   rS   _cmd_opt_autr   __init__)selfoptionsrQ   rR   rS   s        r<   rX   zVimLexer.__init__   sT    GGGGGGGGGG			D,,G,,,,,r;   c                    t          ||f          }|dk    re||dz
           d         |dt          ||dz
           d                            k    r,||dz
           d         dt          |                   |k    rdS |t          |          k     rZ||         d         |dt          ||         d                            k    o&||         d         dt          |                   |k    S dS )a  
        It's kind of difficult to decide if something might be a keyword
        in VimL because it allows you to abbreviate them.  In fact,
        'ab[breviate]' is a good example.  :ab, :abbre, or :abbreviate are
        valid ways to call it so rather than making really awful regexps
        like::

            \bab(?:b(?:r(?:e(?:v(?:i(?:a(?:t(?:e)?)?)?)?)?)?)?)?\b

        we match `\b\w+\b` and then call is_in() on those tokens.  See
        `scripts/get_vimkw.py` for how the lists are extracted.
        r      NTF)r   len)rY   wmappingps       r<   is_inzVimLexer.is_in   s     7QD!!q55qs|A!$9S1a%9%9$9":::qs|AwAw'1,,ts7||1:a=A&9s71:a='9'9&9$:: ,
1gs1vvg&!+,ur;   c              #   f  K   t          j        | |          D ]\  }}}|t          j        u r}|                     || j                  r|t          |fV  <|                     || j                  s|                     || j                  r|t          j	        |fV  |t          |fV  |||fV  d S )N)r   get_tokens_unprocessedr   r4   ra   rU   r   rV   rW   r3   r   )rY   textindextokenvalues        r<   rc   zVimLexer.get_tokens_unprocessed   s      
 1$==	* 	*E5%
""::eTY// -%/////ZZty11 -

5$)44-u44444u,,,,,UE)))))	* 	*r;   N)$r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   rC   rD   rE   _pythonr   r	   r   r   r   r   r
   r   r   r0   r8   r/   r   r6   r   r   r3   r4   r9   rX   ra   rc   r:   r;   r<   r   r   q   s         DgGB B BII
CMLE+G 	g%(SSXeeDkk7D(D$eK(($0 01 g%7XeeDkk7D%%2D2DEEG !16<@16=A'7 &w/vfj)K {+G;T\J$4L3
F<- - -  .* * * * *r;   r   )r(   rC   r   pygments.lexerr   r   r   r   r   r	   pygments.lexers.pythonr
   pygments.tokenr   r   r   r   r   r   r   r   r   __all__r   r   r   r:   r;   r<   <module>rm      s}    
			       N N N N N N N N N N N N N N N N . . . . . .* * * * * * * * * * * * * * * * * * * * * * /
.
.3 3 3 3 3z 3 3 3l# # # # #z # # #J\* \* \* \* \*z \* \* \* \* \*r;   