ó .Qc@s9dZddlZddlmZmZmZmZmZddlm Z m Z m Z m Z m Z mZmZmZmZddlmZdddd d d gZejd ƒZdefd „ƒYZdefd„ƒYZd efd„ƒYZd efd„ƒYZdefd„ƒYZd efd„ƒYZdS(sÉ pygments.lexers.shell ~~~~~~~~~~~~~~~~~~~~~ Lexers for various shells. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. iÿÿÿÿN(tLexert RegexLexert do_insertionstbygroupstinclude( t PunctuationtTexttCommenttOperatortKeywordtNametStringtNumbertGeneric(tshebang_matchest BashLexertBashSessionLexert TcshLexert BatchLexertPowerShellLexertShellSessionLexers.*? c BseZdZdZdddgZddddd d d d d g ZddgZiedƒdedfdedfdedfde j dfedƒgd6defde j fde fde jfdee jeeƒfd efd!efd"e fd#efg d6d$e jfd%e jfd&efd'efd(efd)efd*e jfd+efgd6d,ed-fd.efd/e jfd0efd1efedƒgd6d2ed-fedƒgd6d3ed-fd4efd5efedƒgd6de j d-fedƒgd6Zd6„ZRS(7sH Lexer for (ba|k|)sh shell scripts. *New in Pygments 0.6.* tBashtbashtshtkshs*.shs*.kshs*.bashs*.ebuilds*.eclasss.bashrctbashrcs.bash_*sbash_*sapplication/x-shsapplication/x-shellscripttbasics\$\(\(tmaths\$\(tparens\${#?tcurlyt`t backtickstdatatroots_\b(if|fi|else|while|do|done|for|then|return|function|case|select|continue|until|esac|elif)\s*\bsN\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|declare|dirs|disown|echo|enable|eval|exec|exit|export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|set|shift|shopt|source|suspend|test|time|times|trap|true|type|typeset|ulimit|umask|unalias|unset|wait)\s*\b(?!\.)s#.*\ns\\[\w\W]s(\b\w+)(\s*)(=)s [\[\]{}()=]s<<t||j |ƒƒD]!\} } } || | | fVq–WndS(NitsS^((?:\(\S+\))?(?:|sh\S*?|\w+\S+[@:]\S+(?:\s+\S+)?|\[\S+[@:][^\n]+\].+)[$#%])(.*\n?)iit>(Rtoptionstline_retfinditertgrouptretmatchtstarttappendtlenR tPromptt startswithtget_tokens_unprocessedRtOutput( tselfR&t bashlexertpostcurcodet insertionsR>tlinetmttokstitttv((s?/usr/local/lib/python2.7/site-packages/pygments/lexers/shell.pyRDus:   "  (R(R)R*R+R,R-R.RD(((s?/usr/local/lib/python2.7/site-packages/pygments/lexers/shell.pyRis    cBs8eZdZdZdgZdgZdgZd„ZRS(sh Lexer for shell sessions that works with different command prompts *New in Pygments 1.6.* s Shell Sessions shell-sessions*.shell-sessionsapplication/x-sh-sessionc csvt|j}d}d}g}xtj|ƒD]ö}|jƒ}tjd|ƒ}|r·|sp|jƒ}n|jt |ƒdt j |jdƒfgfƒ||jdƒ7}q1|r|j |ƒ} x5t || ƒD]!\} } } || | | fVqÜWn|jƒt j|fVg}d}q1W|rrx>t ||j |ƒƒD]!\} } } || | | fVqJWndS(NiR7s!^((?:\[?\S+@[^$#%]+)[$#%])(.*\n?)ii(RR9R:R;R<R=R>R?R@RAR RBRDRRE( RFR&RGRHRIRJR>RKRLRMRNRORP((s?/usr/local/lib/python2.7/site-packages/pygments/lexers/shell.pyRD¨s0 "  (R(R)R*R+R,R-R.RD(((s?/usr/local/lib/python2.7/site-packages/pygments/lexers/shell.pyRœs    cBs­eZdZdZdgZddgZdgZejej BZ ide fde e eƒfdejfd ejfd ejfd efd e ee ejƒfd e ee ejƒfde ee ejƒfdefdefedƒde fg d6dejfde dfedƒde fgd6dejfd ejfdejfdefde fdefdefdejfde fd e e e eƒfg d6ZRS(!sR Lexer for the DOS/Windows Batch file format. *New in Pygments 0.7.* t Batchfiletbats*.bats*.cmdsapplication/x-dos-batchs^\s*@s^(\s*)(rem\s.*)$s".*?"s'.*?'s %%?[~$:\w]+%?s::.*s(set)(\s+)(\w+)s(call)(\s+)(:\w+)s(goto)(\s+)(\w+)s›\b(set|call|echo|on|off|endlocal|for|do|goto|if|pause|setlocal|shift|errorlevel|exist|defined|cmdextversion|errorlevel|else|cd|md|del|deltree|cls|choice)\bs\b(equ|neq|lss|leq|gtr|geq)\bRt.R!s\^\^|\^<|\^>|\^\|s\ns#pops[^\'"^]+techos`.*?`s-?\d+t,t=s/\S+s:\w+s\w:\w+s([<>|])(\s*)(\w+)(R(R)R*R+R,R-R.R=t MULTILINEt IGNORECASEtflagsRRRRR R3R4R R2R tLabelRRR1R/R R5(((s?/usr/local/lib/python2.7/site-packages/pygments/lexers/shell.pyRÊsF                      c BsšeZdZdZddgZddgZdgZiedƒded fd ed fd e j d fedƒgd6defde j fde fde jfdee jeeƒfdefde fgd6de jfde jfdefdefdefde jfgd6dedfdefd e jfd!efd"efedƒgd 6d#edfedƒgd 6d e j dfedƒgd 6ZRS($s> Lexer for tcsh scripts. *New in Pygments 0.10.* tTcshttcshtcshs*.tcshs*.cshsapplication/x-cshRs\$\(Rs\${#?RRRR R!s]\b(if|endif|else|while|then|foreach|case|default|continue|goto|breaksw|end|switch|endsw)\s*\bsù\b(alias|alloc|bg|bindkey|break|builtins|bye|caller|cd|chdir|complete|dirs|echo|echotc|eval|exec|exit|fg|filetest|getxvers|glob|getspath|hashstat|history|hup|inlib|jobs|kill|limit|log|login|logout|ls-F|migrate|newgrp|nice|nohup|notify|onintr|popd|printenv|pushd|rehash|repeat|rootnode|popd|pushd|set|shift|sched|setenv|setpath|settc|setty|setxvers|shift|source|stop|suspend|source|suspend|telltc|time|umask|unalias|uncomplete|unhash|universe|unlimit|unset|unsetenv|ver|wait|warp|watchlog|where|which)\s*\bs#.*\ns\\[\w\W]s(\b\w+)(\s*)(=)s [\[\]{}()=]+s<<\s*(\'?)\\?(\w+)[\w\W]+?\2s!(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"s!(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'s\s+s[^=\s\[\]{}()$"\'`\\]+s \d+(?= |\Z)s \$#?(\w+|.)R$s#pops:-s [a-zA-Z0-9_]+s [^}:"\'`$]+R%s\)(R(R)R*R+R,R-R.RR R R/R R0RR1RR2RRR3R4R RR5(((s?/usr/local/lib/python2.7/site-packages/pygments/lexers/shell.pyRsH                     cBsDeZdZdZdddgZdgZdgZejej Bej BZ dj ƒZ dj ƒZd j ƒZd j ƒZid efd d jeƒeeejeƒfdefdejdfdejfdejfdefdejdfdejfdejfdd je ƒefdd jeƒefdd jeƒej fdej!fdefdefdefgd6d ejfd!ejd"fd#d jeƒejfd$ejfgd6d%ejfd&ej"d'fd(ejfd)ejfdejd"fgd6d*ej"fd&ej"d+fd,ej"d"fgd'6Z#RS(-sB For Windows PowerShell code. *New in Pygments 1.5.* t PowerShellt powershelltposhtps1s*.ps1stext/x-powershells±while validateset validaterange validatepattern validatelength validatecount until trap switch return ref process param parameter in if global: function foreach for finally filter end elseif else dynamicparam do default continue cmdletbinding break begin alias \? % #script #private #local #global mandatory parametersetname position valuefrompipeline valuefrompipelinebypropertyname valuefromremainingarguments helpmessage try catchsNand as band bnot bor bxor casesensitive ccontains ceq cge cgt cle clike clt cmatch cne cnotcontains cnotlike cnotmatch contains creplace eq exact f file ge gt icontains ieq ige igt ile ilike ilt imatch ine inotcontains inotlike inotmatch ireplace is isnot le like lt match ne not notcontains notlike notmatch or regex replace wildcards½write where wait use update unregister undo trace test tee take suspend stop start split sort skip show set send select scroll resume restore restart resolve resize reset rename remove register receive read push pop ping out new move measure limit join invoke import group get format foreach export expand exit enter enable disconnect disable debug cxnew copy convertto convertfrom convert connect complete compare clear checkpoint aggregate adds§component description example externalhelp forwardhelpcategory forwardhelptargetname functionality inputs link notes outputs parameter remotehelprunspace role synopsiss\s+s ^(\s*#[#\s]*)(\.(?:%s))([^\n]*$)t|s #[^\n]*?$s (<|<)#tmultlines @"\n.*?\n"@s @'\n.*?\n'@s `[\'"$@-]t"tstrings '([^']|'')*'s2(\$|@@|@)((global|script|private|env):)?[a-z0-9_]+s(%s)\bs-(%s)\bs(%s)-[a-z_][a-z0-9_]*\bs\[[a-z_\[][a-z0-9_. `,\[\]]*\]s-[a-z_][a-z0-9_]*s\w+s[.,{}\[\]$()=+*/\\&%!~?^`|<>-]R!s[^#&.]+s #(>|>)s#pops\.(%s)s[#&.]s[^$`"]+s\$\(tinterpols`"|""s[`$]s[^$)]+s#pushs\)($R(R)R*R+R,R-R.R=tDOTALLRXRWRYtsplittkeywordst operatorstverbst commenthelpRtjoinRRR tDoct MultilinetHeredocRR3R4R R2R RR0tConstanttInterpolR5(((s?/usr/local/lib/python2.7/site-packages/pygments/lexers/shell.pyREsT                   (R*R=tpygments.lexerRRRRRtpygments.tokenRRRRR R R R R t pygments.utilRt__all__tcompileR:RRRRRR(((s?/usr/local/lib/python2.7/site-packages/pygments/lexers/shell.pyt s (@  O3.8C