i7ifB"dZddlZddlmZmZmZmZmZmZddl m Z m Z m Z m Z mZmZmZmZmZmZddlmZmZmZddlmZddlmZddlmZgd Zd ee j>efZ Gd d eZ!Gd de!Z"Gdde!Z#GddeZ$y)z pygments.lexers.csound ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Csound languages. :copyright: Copyright 2006-2025 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 eZdZdZiddefdej fdejfdee efgddejfd ejd fd ejd fd ejdfdejdfgd e dde dfgd e dde dfgddefe ddeeje dfdejdfgde ddejfde fde dfgddefe dde dfgd d!ejfd"ejfd#e dfgde ddejdfgd$d%eeje d&fd'ejfgd&d(ejfde fde d)fd*e d+fd,ejd-fde dfgd)d.ejfd/efe d0gd+d.ejfd/efe d1gd-d2ejfd,ejd3fdejdfgd4e de d$gd5d6ej fd7eej$ej&fd8ej(fgd0de dfd9e fe d$d:e fgd1giZy;)< 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 $goo7H I $ h  L ! vv . !h(  L ! 64 5! )h2  J  L ! "HW__k$J 2 4 goo/L M  3h@ $ L ! goo . k " K!> ? & AhL  J  L ! ; 6 7 MhV  & 8 W__ % +v . Whb  L ! goov 6 chl  ''//;)O ) + ' 9 mhv % ('// : k " 6@ A fC D GOO%J K K ( ' whF . '// *   O $0 GhP . '// *   O $0 QhZ . !7?? 3 GOOW - GOOV ,0 [hf $ L ! L !& ghp  BFLL Q %x fjj'I J V^^ $ qh|  66 "   L ! V   }hJ  KhFr=rceZdZdZdZddgZdgZdZdefe de d d e fd e jfd e e e jfd e dfe ddefdefdedfdej&dfg e ddej*fdedfge dde jdfge ddej&dfgdej&dfe dgdedfdefgdZy )!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>rrsO D|,G IMJ  / 0 - . ' *7## $ "8GV^^#D E g/ 0 I  !8 , + & 6? + GOO%< =/ 6 / 0 djj ) J '  / 0 V^^%H I" / 0 goo/? @$ GOOV , FO ff % v & a4Fr=rceZdZdZdZddgZddgZdZeZ dZ d Z id d e fd e e ejee fed eddej&dfdej&dfdej&fedgddej(j*feddefdefdedfdedfedddefed ddej2fd!ed"fd#e ej2ed"fd$e ej2ed%fd&e ej2ed'fd(e ej2ed)fd*ej4d+fd,ej4d-fd.ej4d/fd0ej4d1fd2ej(j6fd3e fgded d4ej8fd5efd e d6fgded d7e d8fd e d6fgd9ed d:ej:fd;efd e d6fgdded6fded?d@efgddAed6fdBefed>ed?dCefgd>dDej<fgd?dEej>fdFej<fgdGed d;ed6fedgd"ed dHejd6fe d6gd+ed dedIfe d6gdIdJej<fdKej<fedgd-ed dedfdedLfd e d6fgdLdAed6fdMe!e"fgd/ed dedfdedNfd e d6fgdNdAed6fdMe!e#fged dedfdedOfd e d6fgdAed6fdMe!e$fgdPZ%yQ)Rrz8 For `Csound `_ orchestras. zCsound Orchestracsoundz csound-orcz*.orcz*.udor@c#K|jd}|jj||jtj |fyw)Nr)groupuser_defined_opcodesaddstartr Function)lexermatchopcodes r>opcode_name_callbackz)CsoundOrchestraLexer.opcode_name_callbacks>Q ""&&v.kkmT]]F22sAAc#Ktj}|jd}|tvs|tvs|t vr$|j tj|fn||jvr$|j tj|fnt}tjd|}|r]|j dtj|jdf|j dt|jdfn|j t|f|jdrO|j dt|jdf|j d||jdfyyw)Nz^(g?[afikSw])(\w+))r r8rRrrrrUr BuiltinrSrVresearchr)rWrXtype_annotation_tokenrI name_matchs r> name_callbackz"CsoundOrchestraLexer.name_callbacks1 ' {{1~ 7?d&88DO++a.+u{{1~= =++a."7QG G sFFrFr$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>rrsG D&G'"IM53 H*h J  +Xj$**k[e-f g / 0 - . 7..0T U G//1G H $g&9&9 : ( )  h  =t}}?S?S T I  PRZ [ ; ' 6? + fo .  /18 9)% F W w 5 2HW^^[4Y   /'..+1V , . !8GNNK#H = ? ((7>>;*O N PdllO < 2DLLBW X $,, @ & l C $--00 1 4m DA! !hf - / 0 $-- 0 k " J ' / ght  / 0 24V W J '! uh~ ! / 0' 5 ;  J '# hR  66 " F # L ! & ' ' (   Shb  ff % & / & ' ' (    chp  +V]] ; qhZ  7 I FMM " [hd  / 0 ; ' ( ) ehn  / 0 TZZ ( FO ohz  / 0 61 2 FO {hD  &-- 0 $fmm 4 O $! EhP  / 0 6? + fn - J '  Qh\  ff % %(8"9 : ]hf  / 0 6? + fh ' J '  ghr  ff % % "4 5 sh~ / 0 6? + fe $ J '  ff % %/ 2 IhFr=rc eZdZdZdZddgZdgZdZdZde jfd e jfd e fd e jd fd e jdfde jdfde jdfde jfgde jdfdeefgde jdfdeefgde jdfdeefgdefde j(dfde jdfgdefdedfd edfd!edfgd"Zy#)$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>rrs` D ,/G I CM!'"3"3 4 W^^ ,  % !488-A B TXX'7 8 $dhh @ dhh . $dhh /  *488V < 5u=Q7R S $TXXv 6 /7G1H I -dhh ? 8% :J K Z dnnf 5 & ) Z vv & vv &  (  A&Fr=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 OOYY*.. M #Xgnnd%C Dk*k\>{>BN;Nb8*8r=