
    L&ibB                     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-2022 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     c/home/geonatureadmin/si_en_reseau/tutos/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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   zO
    For `Csound <https://csound.com>`_ 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[^}]|\}(?!\}))rE   rA   rB   rC   rD   r,   N)r0   r1   r2   __doc__namealiases	filenamesr   r   r   Constantr   r   r:   r   r   r   r	   r6   r   Labelr;   r<   r=   r>   r   r      sx         D|,G	I 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 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d/ej        d0fd1ej        j        fd2e
fgd ed          d3ej        fd4efd
ed5fgd ed          d6e	d7fd
ed5fgd8 ed          d9ej        fd:efd
ed5fgdded5fd;ef ed<           ed=           ed>          d?efgdd@ed5fdAef ed=           ed>          dBefgd=dCej        fgd>dDej        fdEej        fgdF ed          d:ed5f ed          gd! ed          dGej        d5f ed5          gd* ed          dedHf ed5          gdHdIej        fdJej        f ed          gd, ed          dedfdedKfd
ed5fgdKd@ed5fdL e e!          fgd. ed          dedfdedMfd
ed5fgdMd@ed5fdL e e"          fg ed          dedfdedNfd
ed5fgd@ed5fdL e e#          fgdOZ$dPS )Qr   zS
    For `Csound <https://csound.com>`_ orchestras.

    .. versionadded:: 2.1
    zCsound Orchestracsoundz
csound-orcz*.orcz*.udoc              #      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   rP   r   r   r   rS   r   BuiltinrQ   rT   researchr   )rU   rV   type_annotation_tokenrH   
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=   rE   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))rt   goto argumentz\b(timout)(\(|\b))rt   ru   ru   z\b(loop_[gl][et])(\(|\b))rt   ru   ru   ru   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 signaturesrw   z0|[afijkKoOpPStV\[\]]+,z
[^\\"$%)]+r*   zescape sequenceszformat specifiersz[\\$%)]rF   z(?:[^\\%)}]|\}(?!\}))+z[\\%)]z\\(?:[\\abnrt"]|[0-7]{1,3})z'%[#0\- +]*\d*(?:\.\d+)?[AE-GXac-giosux]z%%ru   z\w+zprints quoted stringz\\\\[aAbBnNrRtT]z%[!nNrRtT]|[~^]{1,2}zCsound scorez([^}]+)|\}(?!\})PythonLua)rv   rz   N)%r0   r1   r2   rG   rH   rI   rJ   setrQ   rX   rb   r   r   r   rL   r   r   r   DeclarationVariableGlobalr   r   r   Pseudor]   InstancerT   r8   EscapeInterpolr   r   r   r   r   r;   r<   r=   r>   r   r      s         D&G'"I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                   z   e Zd ZdZdZddgZdg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   zR
    For `Csound <https://csound.com>`_ documents.

    .. versionadded:: 2.1
    zCsound Documentzcsound-documentz
csound-csdz*.csdz/[*](.|\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>]+)rE   r   r   r   r   r   N)r0   r1   r2   rG   rH   rI   rJ   r	   r4   r5   r   r   Tagr   r   r   r   r   	Attributer   r;   r<   r=   r>   r   r     sb         D ,/G	I !'"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   )%rG   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\? ? ? ? ?{ ? ? ?DO O O O O; O O Od8 8 8 8 8* 8 8 8 8 8r=   