|ebB"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-2023 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=rceZdZdZdZddgZdgZdefededd e fd e jfd e e e jfd e d feddefdefdedfdej$dfg eddej(fdedfgedde jdfgeddej$dfgdej$dfedgdedfdefgdZy) rzO For `Csound `_ scores. .. versionadded:: 2.1 z Csound Scorez csound-scorez csound-scoz*.scor$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 [^}]|\}(?!\}))rErArBrCrDr,N)r0r1r2__doc__namealiases filenamesrrr Constantrr r:rrrr r6r Labelr;r<r=r>rrsJ D|,G IJ  / 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=rceZdZdZdZddgZddgZeZdZ dZ id d e fd e e e jee fed ed dej$dfdej$dfdej$fedgdde j&j(feddefdefdedfdedfedddefedddej0fd ed!fd"e ej0ed!fd#e ej0ed$fd%e ej0ed&fd'e ej0ed(fd)e j2d*fd+e j2d,fd-e j2d.fd/e j2d0fd1e j&j4fd2e fgded d3e j6fd4efd e d5fgded d6e d7fd e d5fgd8ed d9ej8fd:efd e d5fgdded5fd;efed<ed=ed>d?efgdd@ed5fdAefed=ed>dBefgd=dCej:fgd>dDej<fdEej:fgdFed d:ed5fedgd!ed dGe jd5fed5gd*ed dedHfed5gdHdIej:fdJej:fedgd,ed dedfdedKfd e d5fgdKd@ed5fdLe e!fgd.ed dedfdedMfd e d5fgdMd@ed5fdLe e"fged dedfdedNfd e d5fgd@ed5fdLe e#fgdOZ$yP)QrzS For `Csound `_ orchestras. .. versionadded:: 2.1 zCsound Orchestracsoundz csound-orcz*.orcz*.udoc#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 r8rPrrrrSr BuiltinrQrTresearchr)rUrVtype_annotation_tokenrH name_matchs r> name_callbackz"CsoundOrchestraLexer.name_callbacks1 ' {{1~ 7?d&88DO++a.+u{{1~= =++a."7QG G sFFrEr$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))rt goto argumentz\b(timout)(\(|\b))rtruruz\b(loop_[gl][et])(\(|\b))rtrururuz \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 signaturesrwz0|[afijkKoOpPStV\[\]]+,z [^\\"$%)]+r*zescape sequenceszformat specifiersz[\\$%)]rFz(?:[^\\%)}]|\}(?!\}))+z[\\%)]z\\(?:[\\abnrt"]|[0-7]{1,3})z'%[#0\- +]*\d*(?:\.\d+)?[AE-GXac-giosux]z%%ruz\w+zprints quoted stringz\\\\[aAbBnNrRtT]z%[!nNrRtT]|[~^]{1,2}z Csound scorez([^}]+)|\}(?!\})PythonLua)rvrzN)%r0r1r2rGrHrIrJsetrQrXrbrrr rLrrr DeclarationVariableGlobalrrrPseudor]InstancerTr8EscapeInterpolrrrrrr;r<r=r>rrsB D&G'"I53 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 eZdZdZdZddgZdgZdejfdejfde fd e jd fd e jd fd e jdfde jdfde jfgde jdfde efgde jdfde efgde jdfde efgdefde j$dfde jdfgdefdedfdedfdedfgd Zy!)"rzR For `Csound `_ documents. .. versionadded:: 2.1 zCsound Documentzcsound-documentz csound-csdz*.csdz/[*](.|\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>]+)rErrrrrN)r0r1r2rGrHrIrJr r4r5rr Tagrrrrr Attributerr;r<r=r>rrsV D ,/G I!'"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)%rGr^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\?{?DO;Od8*8r=