YBFjSdZddlZddlmZddlmZmZmZmZmZm Z ddl m Z ddl m Z mZmZmZmZmZmZmZmZgdZGdd eZGd d eZGd d eZdS)z pygments.lexers.textedit ~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for languages related to text processing. :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)bisect) RegexLexerbygroupsdefaultincludethisusing) PythonLexer) CommentKeywordNameNumberOperator PunctuationStringText Whitespace)AwkLexerSedLexerVimLexercleZdZdZdZgdZdgZdgZdZdZ de fd e j fge d d ejd fd e dfed gde d fgde dfe d dedfdedfdefdedfdejdfdejfdejfdejfdejfdejfdejfdejfdej fgdZd S)!rz For Awk scripts. Awk)awkgawkmawknawkz*.awkzapplication/x-awkz!https://en.wikipedia.org/wiki/AWKz1.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]?z0x[0-9a-fA-F]+[0-9]+z"(\\\\|\\[^\\]|[^"\\])*"z'(\\\\|\\[^\\]|[^'\\])*')rr"r!rootN)__name__ __module__ __qualname____doc__namealiases filenames mimetypesurl version_addedrr SinglerrRegexrrrr DeclarationReservedr BuiltinOtherrFloatHexIntegerDoubletokensFC:\PYTHON\_runtimes\venv\Lib\site-packages\pygments/lexers/textedit.pyrrsu D---G I$%I -CMTN gn %" G+ , ,L& * t1 2 GFOO  D& ! 4!3 4 G+ , ,()13E G +'9 :  %"$6 8 G/1C D!#*"2 4$%)\ 3tz * 5v| D  +  ' (&- 8 (&- 8- ''FFFr;rceZdZdZdZgdZddgZdgZdZdZ e j Z d Z d d efd ejfd ejfdefdefdefdeeejfdeeejfdeeejfde zdzeeejefde zdzeedejefde zdze zdzeeeejeejefde zdze zdzeeeejeejeefg iZdS)rz% Lexer for Sed script files. Sed)sedgsedssedz*.sedz *.[gs]sedz text/x-sedz!https://en.wikipedia.org/wiki/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,r-r.re MULTILINEflags_inside_delimsrr r/rr7rrr rrr8r0r9r:r;r<rrLs D%%%G+&II -CM LEGN  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;rceZdZdZdZdgZgdZdgZdZdZ e j Z dZ d d e zd zeeeeeeeeeeefd e zd zeeeeeeefd efdefdejfdejfdejfdefdefdejfdefdefdefdejfdejfdefgiZ dZ!dZ"dZ#dS)rz& Lexer for VimL script files. VimLvim) z*.vimz.vimrcz.exrcz.gvimrc_vimrc_exrc_gvimrcvimrcgvimrcz text/x-vimzhttps://www.vim.orgz0.8zpy(?: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 hddlm}m}m}||_||_||_tj|fi|dS)Nr)autocommandoption) pygments.lexers._vim_builtinsrQrRrS_cmd_opt_autr__init__)selfoptionsrQrRrSs r<rXzVimLexer.__init__sTGGGGGGGGGG   D,,G,,,,,r;ct||f}|dkre||dz d|dt||dz dkr,||dz ddt||krdS|t|krZ||d|dt||dko&||ddt||kSdS)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)rYwmappingps r<is_inzVimLexer.is_ins 7QD ! ! q55qs|A!$9S1a%9%9$9":::qs|AwAw'1,,t s7||  1:a=A&9s71:a='9'9&9$::, 1 gs1vvg&!+ ,ur;c#fKtj||D]\}}}|tjur}|||jr |t |fV<|||js|||jr|tj |fV|t|fV|||fVdS)N) rget_tokens_unprocessedr r4rarUr rVrWr3r)rYtextindextokenvalues r<rczVimLexer.get_tokens_unprocesseds 1$== * * E5% ""::eTY//-%/////ZZty11- 5$)44-u44444u,,,,,UE))))) * *r;N)$r%r&r'r(r)r*r+r,r-r.rCrDrE_pythonrr rr rrr r rr0r8r/rr6rr r3r4r9rXrarcr:r;r<rrqs DgGBBBII CM LE+G  g %(S S XeeDkk7D(D$eK(($00 1g % 7 XeeDkk7D%% 2D2D E E G !   16< @ 16= A ' 7&w / v  fj ) K { + G   ;T\ J  $ 4L3 F<---.*****r;r)r(rCrpygments.lexerrrrrrr pygments.lexers.pythonr pygments.tokenr r r rrrrrr__all__rrrr:r;r<rms} NNNNNNNNNNNNNNNN......********************** / . .33333z333l#####z###J\*\*\*\*\*z\*\*\*\*\*r;