|edZddlZddlmZddlmZmZmZmZmZm Z ddl m Z ddl m Z mZmZmZmZmZmZmZmZgdZGdd eZGd d eZGd d eZy)z pygments.lexers.textedit ~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for languages related to text processing. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)bisect) RegexLexerbygroupsdefaultincludethisusing) PythonLexer) CommentKeywordNameNumberOperator PunctuationStringText Whitespace)AwkLexerSedLexerVimLexerceZdZdZdZgdZdgZdgZdefde jfge dd e jd fd ed fed gd ed fgdedfe ddedfdedfdefdedfdej$dfdej&fdej*fdej,fdej0fdej2fdej4fde j6fde jfgdZy)rz5 For Awk scripts. .. versionadded:: 1.5 Awk)awkgawkmawknawkz*.awkzapplication/x-awk\s+#.*$commentsandwhitespacez(/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/\B#popz(?=/))r badregexz\nz ^(?=\s|/)slashstartsregexz3\+\+|--|\|\||&&|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]?z0x[0-9a-fA-F]+[0-9]+z"(\\\\|\\[^\\]|[^"\\])*"z'(\\\\|\\[^\\]|[^'\\])*')rr"r!rootN)__name__ __module__ __qualname____doc__namealiases filenames mimetypesrr SinglerrRegexrrrr DeclarationReservedr BuiltinOtherrFloatHexIntegerDoubletokens:/usr/lib/python3/dist-packages/pygments/lexers/textedit.pyrrsY D-G I$%ITN gnn %" + ,LL& * t1 2 FO  D& ! 4!3 4 + ,()13E G +'9 :  %"$6 8 G//1C D!#*"2"2 4$%)\\ 3tzz * 5v|| D  +  ' (&-- 8 (&-- 8- 'Fr9rc:eZdZdZdZgdZddgZdgZejZ dZ dd e fd e jfd ej fd efd efdefdeeejfdeeej,fdeeej fde zdzeeej.efde zdzeedej.efde zdze zdzeeeejeejefde zdze zdzeeeej.eejeefg iZy)rz% Lexer for Sed script files. Sed)sedgsedssedz*.sedz *.[gs]sedz text/x-sedz.((?:(?:\\[^\n]|[^\\])*?\\\n)*?(?:\\.|[^\\])*?)r$rrr#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,re MULTILINEflags_inside_delimsrr r-rr5rrr rrr6r.r7r8r9r:rrLsq D%G+&II LLEGN  Z gnn %  ' H   % #W - ''6==)I J 2HWfmm4T U &.. A B n $v -x V\\S^/_ ` . (7 2 k4{ C E  '' 1N BW L g{FMM; Wb c e  '' 1N BEb b g{FLL+v}}Va  Fr9rceZdZdZdZdgZgdZdgZejZ dZ dde zd ze e eeeeeee eefde zd ze e eeee efd efd efd ej*fdej,fdej.fdefdefdej2fdefdefdefdej8fdej:fdefgiZdZdZ dZ!y)rzA Lexer for VimL script files. .. versionadded:: 0.8 VimLvim) z*.vimz.vimrcz.exrcz.gvimrc_vimrc_exrc_gvimrcvimrcgvimrcz text/x-vimzpy(?: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 nddlm}m}m}||_||_||_tj|fi|y)Nr)autocommandoption) pygments.lexers._vim_builtinsrNrOrP_cmd_opt_autr__init__)selfoptionsrNrOrPs r:rUzVimLexer.__init__s0GG   D,G,r9c,t||f}|dkDr>||dz d|dt||dz dk(r||dz ddt||k(ry|t|kr6||d|dt||dk(xr||ddt||k(Sy)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. rNTF)rlen)rVwmappingps r:is_inzVimLexer.is_ins 7QD ! q5qs|A!$9S1a%9"::qs|AwA'1, s7| 1:a=A&9s71:a='9$::, 1 gs1v&!+ ,r9c#Ktj||D]\}}}|tjur|j ||j r |t |fA|j ||js|j ||jr|tj|f|t|f|||fyw)N) rget_tokens_unprocessedr r2r^rRr rSrTr1r)rVtextindextokenvalues r:r`zVimLexer.get_tokens_unprocesseds 11$= * E5% "::eTYY/%//ZZtyy1 5$))4u44u,,UE)) *sBN)"r%r&r'r(r)r*r+r,r@rArB_pythonrr rr rrr r rr.r6r-rr4rr r1r2r7rUr^r`r8r9r:rrosA DgGBII LLE+G  g %(S S eDk7D(D$K($0 1g % 7 eDk7D% 2D E G !   16<< @ 16== A ' 7&w / v  fjj ) K { + G   ;T\\ J  $ 4L3 F<-.*r9r)r(r@rpygments.lexerrrrrrr pygments.lexers.pythonr pygments.tokenr r r rrrrrr__all__rrrr8r9r:rjsY NN.*** /3z3l!z!F[*z[*r9