
    MhfB                     8   d Z ddlZddlmZmZmZmZmZmZ ddl	m
Z
mZmZmZmZmZmZmZmZmZ ddlmZmZmZ ddlmZ ddlmZ ddlmZ g d	Zd
 ee
j        e          fZ  G d de          Z! G d de!          Z" G d de!          Z# G d de          Z$dS )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)
RegexLexerbygroupsdefaultincludeusingwords)
CommentErrorKeywordNameNumberOperatorPunctuationStringText
Whitespace)OPCODESDEPRECATED_OPCODESREMOVED_OPCODES)	HtmlLexer)PythonLexer)LuaLexer)CsoundScoreLexerCsoundOrchestraLexerCsoundDocumentLexerz((?:(?:;|//).*)*)(\n)c            
          e Zd ZdZi ddefdej        fdej        fd ee	e          fgddej
        fd	ej
        d
fdej
        dfdej
        dfdej
        dfgd ed          dedfgd
 ed          dedfgddef ed          d eej
        e          dfdej
        dfgd ed          dej
        fdefdedfgddef ed          dedfgd d!ej
        fd"ej
        fd#edfgd ed          dej
        dfgd$d% eej
        e          d&fd'ej
        fgd&d(ej
        fdefded)fd*ed+fd,ej
        d-fdedfgd)d.ej
        fd/ef ed0          gd+d.ej
        fd/ef ed1          gd-d2ej
        fd,ej
        d3fdej
        dfgd4 ed           ed$          gd5d6ej        fd7 eej        ej                  fd8ej        fgd0dedfd9ef ed$          d:efgd1g iZd;S )<CsoundLexerzhttps://csound.com/
whitespacez[ \t]+z/[*](?:.|\n)*?[*]/(?:;|//).*$z(\\)(\n)preprocessor directivesz)#(?:e(?:nd(?:if)?|lse)\b|##)|@@?[ \t]*\d+z#includestrzincludestr directivez#includezinclude directivez#[ \t]*definezdefine directivez#(?:ifn?def|undef)\bzmacro 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(?<!\\)#
macro usesz(\$[A-Z_a-z]\w*\.?)(\()zmacro parameter value listz\$[A-Z_a-z]\w*(?:\.|\b)z(?:[^\'#"{()]|\{(?!\{))+z#macro parameter value quoted string\{\{z#macro parameter value braced stringz\(z#macro parameter value parentheticalz\\[#'()]z[#'()]r#   braced stringz(?:[^\\()]|\\\))+z#pushwhitespace and macro usesnumbersz2\d+[Ee][+-]?\d+|(\d+\.\d*|\d*\.\d+)([Ee][+-]?\d+)?z(0[Xx])([0-9A-Fa-f]+)\d+z[^"$]+z[$]N)__name__
__module____qualname__urlr   r	   	MultilineSingler   r   Preprocr   r   r   r
   r   Floatr   TypeHexIntegertokens     V/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pygments/lexers/csound.pyr   r      s       
Ch
#"G$56W^,((4445	
h 	"97?KW_.DE'/+>?w0BC$go7HI$
h  	GL!!vv.
!h( 	GL!!645!
)h2 	JGL!!"HHW_k$J$J24go/LM
3h@ 	$GL!!go.k"K!>?	&
AhL 	JGL!!; 67
MhV 	&8W_%+v.
Whb 	GL!!gov6
chl 	''/;)O)O)+'9
mhv 	%('/:k"6@AfCDGO%JKK('
whF 	.'/*GO$$0
GhP 	.'/*GO$$0
QhZ 	.!7?3GOW-GOV,0
[hf 	$GL!!GL!!&
ghp 	BFLQ%xxfj'I'IJV^$
qh| 	66"GL!!V	
}hJ 	 
Kh hFFFr=   r   c                      e Zd ZdZdZddgZdgZdZdef e	d           e	d	          d
e
fde
j        fd ee
ej                  fde
df e	d          defdefdedfdej        dfg e	d          dej        fdedfg e	d          dej        dfg e	d          dej        dfgdej        df e	d          gdedfdefgdZd S )!r   z4
    For `Csound <https://csound.com>`_ scores.
    zCsound Scorezcsound-scorez
csound-scoz*.sco2.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[^}]|\}(?!\}))rF   rB   rC   rD   rE   r,   N)r0   r1   r2   __doc__namealiases	filenamesversion_addedr   r   r   Constantr   r   r:   r   r   r   r	   r6   r   Labelr;   r<   r=   r>   r   r      s}         D|,G	IM J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&
a4 4FFFr=   r   c                      e Zd ZdZdZddgZddgZdZ e            Z	d Z
d	 Zi d
defd eeej        ee          f ed           ed          dej        dfdej        dfdej        f ed          gddej        j        f ed          defdefdedfdedf eddd          ef ed dd          ej        fd!ed"fd# eej        e          d"fd$ eej        e          d%fd& eej        e          d'fd( eej        e          d)fd*ej        d+fd,ej        d-fd.ej        d/fd0ej        d1fd2ej        j        fd3efgd ed          d4ej        fd5efded6fgd ed          d7e
d8fded6fgd9 ed          d:ej        fd;efded6fgdded6fd<ef ed=           ed>           ed?          d@efgddAed6fdBef ed>           ed?          dCefgd>dDej        fgd?dEej        fdFej        fgdG ed          d;ed6f ed          gd" ed          dHej        d6f e d6          gd+ ed          dedIf e d6          gdIdJej        fdKej        f ed          gd- ed          dedfdedLfded6fgdLdAed6fdM e!e"          fgd/ ed          dedfdedNfded6fgdNdAed6fdM e!e#          fg ed          dedfdedOfded6fgdAed6fdM e!e$          fgdPZ%dQS )Rr   z8
    For `Csound <https://csound.com>`_ orchestras.
    zCsound Orchestracsoundz
csound-orcz*.orcz*.udor@   c              #      K   |                     d          }| j                            |           |                                t          j        |fV  d S )Nr   )groupuser_defined_opcodesaddstartr   Function)lexermatchopcodes      r>   opcode_name_callbackz)CsoundOrchestraLexer.opcode_name_callback   sO      Q"&&v...kkmmT]F222222r=   c              #   \  K   t           j        }|                    d          }|t          v s|t          v s	|t
          v r$|                                t          j        |fV  n|| j	        v r$|                                t          j
        |fV  nt          }t          j        d|          }|rj|                    d          t           j        |                    d          fV  |                    d          t          |                    d          fV  n|                                t          |fV  |                    d          ra|                    d          t          |                    d          fV  |                    d          ||                    d          fV  d S d S )N   z^(g?[afikSw])(\w+)      )r   r8   rR   r   r   r   rU   r   BuiltinrS   rV   researchr   )rW   rX   type_annotation_tokenrI   
name_matchs        r>   name_callbackz"CsoundOrchestraLexer.name_callback   s      '{{1~~7??d&888DO<S<S++--t33333U///++--44444$(!#8$??J 0 &&q))7<9I9I!9L9LLLLL &&q))41A1A!1D1DDDDDDkkmmT4////;;q>> 	H++a..+u{{1~~====++a.."7QGGGGGG	H 	Hr=   rF   r$   z^([ \t]*)(\w+)(:)([ \t]+|$)r-   r    z	\binstr\bz"instrument numbers and identifiersz
\bopcode\bzafter opcode keywordz\b(?:end(?:in|op))\bzpartial statementsz-\b(?:0dbfs|A4|k(?:r|smps)|nchnls(?:_i)?|sr)\br.   u@   \+=|-=|\*=|/=|<<|>>|<=|>=|==|!=|&&|\|\||[~¬]|[=!+\-*/^%&|<>#?:]z	[(),\[\]]r"   r#   r+   r,   )doelseelseifendifenduntilfiifithenkthenodthenuntilwhilez\b)prefixsuffix)returnrireturnz\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))rv   rw   rw   z\b(loop_[gl][et])(\(|\b))rv   rw   rw   rw   z\bprintk?s\bzprints opcodez"\b(?:readscore|scoreline(?:_i)?)\bzCsound 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 signaturesry   z0|[afijkKoOpPStV\[\]]+,z
[^\\"$%)]+r*   zescape sequenceszformat specifiersz[\\$%)]rG   z(?:[^\\%)}]|\}(?!\}))+z[\\%)]z\\(?:[\\abnrt"]|[0-7]{1,3})z'%[#0\- +]*\d*(?:\.\d+)?[AE-GXac-giosux]z%%rw   z\w+zprints quoted stringz\\\\[aAbBnNrRtT]z%[!nNrRtT]|[~^]{1,2}zCsound scorez([^}]+)|\}(?!\})PythonLua)rx   r|   N)&r0   r1   r2   rH   rI   rJ   rK   rL   setrS   rZ   rd   r   r   r   rN   r   r   r   DeclarationVariableGlobalr   r   r   Pseudor_   InstancerV   r8   EscapeInterpolr   r   r   r   r   r;   r<   r=   r>   r   r      s         D&G'"IM3553 3 3
H H H*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9 U)%FFFWw52HHW^[4Y4Y/'.+1V1V,.!88GNK#H#H=?(((7>;*O*ONP dlO<2DLBWX $,@&lC$-014mDA!
!hf 	-G/00 $-0k"J'	/
ght 	G/0024VWJ'!
uh~ 	!G/00 '5;J'#
hR 	66"F#GL!!G&''G'(( 
Shb 	ff%&/G&''G'((
chp 	+V];
qhZ 	7IFM"
[hd 	G/00;'G())
ehn 	G/00TZ(GFOO
ohz 	G/00612GFOO
{hD 	 &-0$fm4GO$$!
EhP 	G/006?+fn-J'	 
Qh\ 	ff% %%(8"9"9:
]hf 	G/006?+fh'J'	
ghr 	ff% %%"4"45
sh~ G/006?+fe$J'	
 ff% %%//2
Ih h hFFFr=   r   c                      e Zd ZdZdZddgZdgZdZdZde	j
        fd	e	j        fd
efdej        dfdej        dfdej        dfdej        dfdej        fgdej        dfd ee          fgdej        dfd ee          fgdej        dfd ee          fgdefdej        dfdej        dfgdefdedfd edfd!edfgd"Zd#S )$r   z
    For Csound documents.
    zCsound Documentzcsound-documentz
csound-csdz*.csdzhttps://csound.comr@   z/[*](.|\n)*?[*]/r   z[^/;<]+|/(?!/)z<\s*CsInstruments)	orchestratagz<\s*CsScore)scorer   z<\s*[Hh][Tt][Mm][Ll])HTMLr   z<\s*[\w:.-]+r   z<\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>]+)rF   r   r   r   r   r   N)r0   r1   r2   rH   rI   rJ   rK   r3   rL   r	   r4   r5   r   r   Tagr   r   r   r   r   	Attributer   r;   r<   r=   r>   r   r     sl         D ,/G	I
CM !'"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   )%rH   r`   pygments.lexerr   r   r   r   r   r   pygments.tokenr	   r
   r   r   r   r   r   r   r   r    pygments.lexers._csound_builtinsr   r   r   pygments.lexers.htmlr   pygments.lexers.pythonr   pygments.lexers.scriptingr   __all__r5   newliner   r   r   r   r<   r=   r>   <module>r      s    
			 O O O O O O O O O O O O O O O O                        Y Y Y Y Y Y Y Y Y Y * * * * * * . . . . . . . . . . . .
M
M
M#XXgnd%C%C
Dk k k k k* k k k\> > > > >{ > > >BN N N N N; N N Nb8 8 8 8 8* 8 8 8 8 8r=   