YBFjiB8dZddlZddlmZmZmZmZmZmZddl m Z m Z m Z m Z mZmZmZmZmZmZddlmZmZmZddlmZddlmZddlmZgd Zd ee jefZ Gd d eZ!Gd de!Z"Gdde!Z#GddeZ$dS)z pygments.lexers.csound ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Csound languages. :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N) RegexLexerbygroupsdefaultincludeusingwords) CommentErrorKeywordNameNumberOperator PunctuationStringText Whitespace)OPCODESDEPRECATED_OPCODESREMOVED_OPCODES) HtmlLexer) PythonLexer)LuaLexer)CsoundScoreLexerCsoundOrchestraLexerCsoundDocumentLexerz((?:(?:;|//).*)*)(\n)c eZdZdZiddefdejfdejfdee efgddej fd ej d fd ej d fd ej dfdej dfgd e dde dfgd e dde dfgddefe ddeej e dfdej dfgde ddej fde fde dfgddefe dde dfgd d!ej fd"ej fd#e dfgde ddej dfgd$d%eej e d&fd'ej fgd&d(ej fde fde d)fd*e d+fd,ej d-fde dfgd)d.ej fd/efe d0gd+d.ej fd/efe d1gd-d2ej fd,ej d3fdej dfgd4e de d$gd5d6ejfd7eejejfd8ejfgd0de dfd9e fe d$d:e fgd1giZd;S)< CsoundLexerzhttps://csound.com/ whitespacez[ \t]+z/[*](?:.|\n)*?[*]/ (?:;|//).*$z(\\)(\n)preprocessor directivesz)#(?:e(?:nd(?:if)?|lse)\b|##)|@@?[ \t]*\d+z #includestrzincludestr directivez#includezinclude directivez #[ \t]*definezdefine directivez#(?:ifn?def|undef)\bzmacro directivez ([^ \t]).*?\1#pop")r! quoted string\nz([A-Z_a-z]\w*)(\())r!macro parameter name list [A-Z_a-z]\w*)r!before macro bodyr%z['#]z\)r'#)r! macro bodyr)z(?:\\(?!#)|[^#\\]|\n)+z\\#z(? ? w0B C $go7H I $ h  GL ! ! vv . !h(  GL ! ! 64 5! )h2  J  GL ! ! "HHW_k$J$J 2 4 go/L M  3h@ $ GL ! ! go . k " K!> ? & AhL  J  GL ! ! ; 6 7 MhV  & 8 W_ % +v . Whb  GL ! ! gov 6 chl  ''/;)O)O ) + ' 9 mhv % ('/ : k " 6@ A fC D GO%J K K ( ' whF . '/ *   GO $ $0 GhP . '/ *   GO $ $0 QhZ . !7? 3 GOW - GOV ,0 [hf $ GL ! ! GL ! !& ghp  BFL Q %xx fj'I'I J V^ $ qh|  66 "   GL ! ! V   }hJ  KhhFFFr=rceZdZdZdZddgZdgZdZdefe de d d e fd e j fd e e e jfd e dfe ddefdefdedfdejdfg e ddejfdedfge dde jdfge ddejdfgdejdfe dgdedfdefgdZd S)!rz4 For `Csound `_ scores. z Csound Scorez csound-scorez csound-scoz*.sco2.1r$r-r z[aBbCdefiqstvxy]zz([nNpP][pP])(\d+)z[mn]mark statementr.z[!+\-*/^%&|<>#~.]z[()\[\]]r"r#z\{loop after left bracer&r!r/)r!loop after repeat count)r!loopz\}root\}\}z [^}]|\}(?!\}))rFrBrCrDrEr,N)r0r1r2__doc__namealiases filenames version_addedrrr Constantrr r:rrrr r6r Labelr;r<r=r>rrs} D|,G IMJ  G/ 0 0 G- . . ' *7# $ "88GV^#D#D E g/ 0 GI   !8 , + & 6? + GO%< =/ 6 G/ 0 0 dj ) J '  G/ 0 0 V^%H I" G/ 0 0 go/? @$ GOV , GFOO ff % v & a44FFFr=rceZdZdZdZddgZddgZdZeZ dZ d Z id d e fd e e ejee fed eddejdfdejdfdejfedgddejjfeddefdefdedfdedfedddefed ddejfd!ed"fd#e ejed"fd$e ejed%fd&e ejed'fd(e ejed)fd*ejd+fd,ejd-fd.ejd/fd0ejd1fd2ejjfd3e fgded d4ejfd5efd e d6fgded d7e d8fd e d6fgd9ed d:ejfd;efd e d6fgdded6fded?d@efgddAed6fdBefed>ed?dCefgd>dDejfgd?dEejfdFejfgdGed d;ed6fedgd"ed dHejd6fe d6gd+ed dedIfe d6gdIdJejfdKejfedgd-ed dedfdedLfd e d6fgdLdAed6fdMe!e"fgd/ed dedfdedNfd e d6fgdNdAed6fdMe!e#fged dedfdedOfd e d6fgdAed6fdMe!e$fgdPZ%dQS)Rrz8 For `Csound `_ orchestras. zCsound Orchestracsoundz csound-orcz*.orcz*.udor@c#K|d}|j||tj|fVdS)Nr)groupuser_defined_opcodesaddstartr Function)lexermatchopcodes r>opcode_name_callbackz)CsoundOrchestraLexer.opcode_name_callbacksOQ "&&v...kkmmT]F222222r=c#\Ktj}|d}|tvs|tvs |t vr$|tj|fVn||j vr$|tj |fVnt}tj d|}|rj|dtj|dfV|dt|dfVn|t|fV|dra|dt|dfV|d||dfVdSdS)Nz^(g?[afikSw])(\w+))r r8rRrrrrUr BuiltinrSrVresearchr)rWrXtype_annotation_tokenrI name_matchs r> name_callbackz"CsoundOrchestraLexer.name_callbacks ' {{1~~ 7??d&888DO> H++a..+u{{1~~= = = =++a.."7QG G G G G G H Hr=rFr$z^([ \t]*)(\w+)(:)([ \t]+|$)r-r z \binstr\bz"instrument numbers and identifiersz \bopcode\bzafter opcode keywordz\b(?:end(?:in|op))\bzpartial statementsz-\b(?:0dbfs|A4|k(?:r|smps)|nchnls(?:_i)?|sr)\br.u@\+=|-=|\*=|/=|<<|>>|<=|>=|==|!=|&&|\|\||[~¬]|[=!+\-*/^%&|<>#?:]z [(),\[\]]r"r#r+r,) doelseelseifendifenduntilfiifithenkthenodthenuntilwhilez\b)prefixsuffix)returnrireturnz \b[ik]?goto\b goto labelz"\b(r(?:einit|igoto)|tigoto)(\(|\b)z\b(c(?:g|in?|k|nk?)goto)(\(|\b))rv goto argumentz\b(timout)(\(|\b))rvrwrwz\b(loop_[gl][et])(\(|\b))rvrwrwrwz \bprintk?s\bz prints opcodez"\b(?:readscore|scoreline(?:_i)?)\bzCsound score opcodez\bpyl?run[it]?\bz Python opcodez\blua_(?:exec|opdef)\b Lua opcodez\bp\d+\bz$\b([A-Z_a-z]\w*)(?:(:)([A-Za-z]))?\bz\d+|[A-Z_a-z]\w*z[+,]r!r&)r!opcode type signaturesryz0|[afijkKoOpPStV\[\]]+,z [^\\"$%)]+r*zescape sequenceszformat specifiersz[\\$%)]rGz(?:[^\\%)}]|\}(?!\}))+z[\\%)]z\\(?:[\\abnrt"]|[0-7]{1,3})z'%[#0\- +]*\d*(?:\.\d+)?[AE-GXac-giosux]z%%rwz\w+zprints quoted stringz\\\\[aAbBnNrRtT]z%[!nNrRtT]|[~^]{1,2}z Csound scorez([^}]+)|\}(?!\})PythonLua)rxr|N)&r0r1r2rHrIrJrKrLsetrSrZrdrrr rNrrr DeclarationVariableGlobalrrrPseudor_InstancerVr8EscapeInterpolrrrrrr;r<r=r>rrs D&G'"IM355333 HHH*h J  +XXj$*k[e-f-f g G/ 0 0 G- . . 7.0T U G/1G H $g&9 : G( ) )  h  =t}?S T GI   PRZ [ ; ' 6? + fo . U ///18 9U)% F F F W w 5 2HHW^[4Y4Y   /'.+1V1V , . !88GNK#H#H = ? (((7>;*O*O N PdlO < 2DLBW X $, @ & l C $-0 1 4m DA! !hf - G/ 0 0 $- 0 k " J ' / ght  G/ 0 0 24V W J '! uh~ ! G/ 0 0' 5 ;  J '# hR  66 " F # GL ! ! G& ' ' G' ( (   Shb  ff % & / G& ' ' G' ( (    chp  +V] ; qhZ  7 I FM " [hd  G/ 0 0 ; ' G( ) ) ehn  G/ 0 0 TZ ( GFOO ohz  G/ 0 0 61 2 GFOO {hD  &- 0 $fm 4 GO $ $! EhP  G/ 0 0 6? + fn - J '  Qh\  ff % %%(8"9"9 : ]hf  G/ 0 0 6? + fh ' J '  ghr  ff % %% "4"4 5 sh~ G/ 0 0 6? + fe $ J '  ff % %%// 2 IhhhFFFr=rc eZdZdZdZddgZdgZdZdZde j fd e j fd e fd e jd fd e jdfde jdfde jdfde jfgde jdfdeefgde jdfdeefgde jdfdeefgdefde jdfde jdfgdefdedfd edfd!edfgd"Zd#S)$rz For Csound documents. zCsound Documentzcsound-documentz csound-csdz*.csdzhttps://csound.comr@z/[*](.|\n)*?[*]/rz[^/;<]+|/(?!/)z<\s*CsInstruments) orchestratagz <\s*CsScore)scorerz<\s*[Hh][Tt][Mm][Ll])HTMLrz <\s*[\w:.-]+rz<\s*/\s*[\w:.-]+\s*>z<\s*/\s*CsInstruments\s*>r!z%(.|\n)+?(?=<\s*/\s*CsInstruments\s*>)z<\s*/\s*CsScore\s*>z(.|\n)+?(?=<\s*/\s*CsScore\s*>)z<\s*/\s*[Hh][Tt][Mm][Ll]\s*>z((.|\n)+?(?=<\s*/\s*[Hh][Tt][Mm][Ll]\s*>)z\s+z [\w.:-]+\s*=attrz/?\s*>z".*?"z'.*?'z[^\s>]+)rFrrrrrN)r0r1r2rHrIrJrKr3rLr r4r5rr Tagrrrrr Attributerr;r<r=r>rrsl D ,/G I CM!'"3 4 W^ ,  % !48-A B TX'7 8 $dh @ dh . $dh /  *48V < 5uu=Q7R7R S $TXv 6 /7G1H1H I -dh ? 8%% :J:J K Z dnf 5 & ) Z vv & vv &  (  A&&FFFr=r)%rHr`pygments.lexerrrrrrrpygments.tokenr r r r r rrrrr pygments.lexers._csound_builtinsrrrpygments.lexers.htmlrpygments.lexers.pythonrpygments.lexers.scriptingr__all__r5newlinerrrrr<r=r>rs OOOOOOOOOOOOOOOOYYYYYYYYYY******............ M M M #XXgnd%C%C Dkkkkk*kkk\>>>>>{>>>BNNNNN;NNNb88888*88888r=