
    ,hfB                     "   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$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)
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y;)<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     X/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/pygments/lexers/csound.pyr   r      s   
Ch
#"G$5$56W^^,(445	
h 	"97??KW__.DE'//+>?w0BC$goo7HI$
h  	L!vv.
!h( 	L!645!
)h2 	JL!"HW__k$J24goo/LM
3h@ 	$L!goo.k"K!>?	&
AhL 	JL!; 67
MhV 	&8W__%+v.
Whb 	L!goov6
chl 	''//;)O)+'9
mhv 	%('//:k"6@AfCDGOO%JKK('
whF 	.'//*O$0
GhP 	.'//*O$0
QhZ 	.!7??3GOOW-GOOV,0
[hf 	$L!L!&
ghp 	BFLLQ%xfjj'IJV^^$
qh| 	66"L!V	
}hJ 	 
KhFr=   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y )!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      sO    D|,G	IM J/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&
a4Fr=   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j2                  fd!ed"fd# eej2                  e      d"fd$ eej2                  e      d%fd& eej2                  e      d'fd( eej2                  e      d)fd*ej4                  d+fd,ej4                  d-fd.ej4                  d/fd0ej4                  d1fd2ej(                  j6                  fd3efgd ed      d4ej8                  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%yQ)Rr   z8
    For `Csound <https://csound.com>`_ orchestras.
    zCsound Orchestracsoundz
csound-orcz*.orcz*.udor@   c              #      K   |j                  d      }| j                  j                  |       |j                         t        j
                  |f y w)Nr   )groupuser_defined_opcodesaddstartr   Function)lexermatchopcodes      r>   opcode_name_callbackz)CsoundOrchestraLexer.opcode_name_callback   s>     Q""&&v.kkmT]]F22s   AAc              #     K   t         j                  }|j                  d      }|t        v s|t        v s|t
        v r$|j                         t        j                  |f n|| j                  v r$|j                         t        j                  |f nt        }t        j                  d|      }|r]|j                  d      t         j                  |j                  d      f |j                  d      t        |j                  d      f n|j                         t        |f |j                  d      rO|j                  d      t        |j                  d      f |j                  d      ||j                  d      f y y w)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   s1     '{{1~7?d&88DO<S++-t33U///++-44$(!#8$?J &&q)7<<9I9I!9LLL &&q)41A1A!1DDDkkmT4//;;q>++a.+u{{1~==++a."7QGG s   FF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      sG    D&G'"IM53
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P dllO<2DLLBWX $,,@&lC$--0014mDA!
!hf 	-/0 $--0k"J'	/
ght 	/024VWJ'!
uh~ 	!/0 '5;J'#
hR 	66"F#L!&''( 
Shb 	ff%&/&''(
chp 	+V]];
qhZ 	7IFMM"
[hd 	/0;'()
ehn 	/0TZZ(FO
ohz 	/0612FO
{hD 	 &--0$fmm4O$!
EhP 	/06?+fn-J'	 
Qh\ 	ff% %(8"9:
]hf 	/06?+fh'J'	
ghr 	ff% %"45
sh~ /06?+fe$J'	
 ff% %/2
IhFr=   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y#)$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     s`    D ,/G	I
CM !'"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   )%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   Y Y * . .
M#Xgnnd%C
Dk* k\>{ >BN; Nb8* 8r=   