o
    -wi 1                     @   s   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 ddl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 deZG dd deZG dd deZG dd deZ dS )z
    pygments.lexers.csound
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for CSound languages.

    :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
RegexLexerbygroupsdefaultincludeusingwords)CommentKeywordNameNumberOperatorPunctuationStringText)OPCODES)	HtmlLexer)PythonLexer)LuaLexer)CsoundScoreLexerCsoundOrchestraLexerCsoundDocumentLexerz((?:(?:;|//).*)*)(\n)c                   @   s,  e Zd Zdefdefdejfgdeejedfdejfgdeejefdeejed	fge	d
e	dgdejfdejdfdejdfdejfge	d
de
dfge	d
deejedfdejdfge	d
dedfgdejfdedfgdeejefdeejedfgdefdedfgdejfded fgd!Zd"S )#CsoundLexerz[ \t]+z\\\n/[*](.|\n)*?[*]/z(\$\w+\.?)(\()function macro callz\$\w+(\.|\b)z((?:\\['\)]|[^'\)])+)(')z([^'\)]+)(\))#pop
whitespace
macro callz$#(e(nd(if)?|lse)|ifn?def|undef)\b|##z
#include\br   z#[ \t]*define\b
macro namez@+[ \t]*\d*"single-line stringz	(\w+)(\()function macro argument list\w+"object macro definition after name#object macro replacement textz(\\#|[^#])+z#pop:3z(\w+)(['#])z	(\w+)(\))$function macro definition after namefunction macro replacement textz#pop:4)r   r   r   whitespace or macro callpreprocessor directivesr   r   r"   r$   r    r%   r&   N)__name__
__module____qualname__r   r   	Multiliner   Preprocr   r   r   tokens r/   r/   `/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/csound.pyr      s`    



r   c                	   @   s   e Zd ZdZdZddgZdgZeddej	fdej
fd	ejfd
edfdefdefdejfgeded edgeeddedfdedfgd
edfdefgdZdS )r   zT
    For `Csound <http://csound.github.io>`_ scores.

    .. versionadded:: 2.1
    zCsound Scorezcsound-scorez
csound-scoz*.scor(   ,\d+e[+-]?\d+|(\d+\.\d*|\d*\.\d+)(e[+-]?\d+)?0[xX][a-fA-F0-9]+\d+r   r   z[+\-*/%^!=<>|&#~.]z[]()[]r!   r'   r   partial statementz[{}]	statementz[abefimq-tv-z]|[nN][pP]?r   z[^\\"]+)r5   r6   rootr   N)r)   r*   r+   __doc__namealiases	filenamesr   r   FloatHexIntegerr   r   r   r   r-   newliner	   r.   r/   r/   r/   r0   r   ]   s6    
r   c                   @   s  e Zd ZdZdZddgZdgZe Zdd Z	dd	 Z
i d
deejefgdeddejjfdejfdejfdejfdedfdedfdefdefeddddefeddddedfeddddedfedddded fd!ejd"fd#ejd$fd%ejd&fd'e
fgd(ed)ed* edgd+eed)d,ed-fd.ed/fed
ed(gd0ed)d1ejfd2efed* gd3eed)d4ed5fed
ed(gd6ed)d7e	d5fgd8ed)d9ejd5fd2efgd:ed)ed* gd;eed)d<ed5fed
ed(gded)d=ejd5fed5gd>ed)d2ed5fedgded?ded5fd@ejfdAej fdBefdCefgddDed5fdEefgd"ed)dedFfed5gdFdDed5fdGe!e"fgd$ed)dedHfed5gdDed5fdGe!e#fged)dedfdedIfd2efed5gdDed5fdGe!e$fgdJZ%dKS )Lr   zX
    For `Csound <http://csound.github.io>`_ orchestras.

    .. versionadded:: 2.1
    zCsound Orchestracsoundz
csound-orcz*.orcc                 c   s.    | d}| j| | tj|fV  d S )Nr   )groupuser_defined_opcodesaddstartr
   Function)lexermatchopcoder/   r/   r0   opcode_name_callback   s   
z)CsoundOrchestraLexer.opcode_name_callbackc                 c   s    | d}td|s|tv r| tj|fV  d S || jv r+| tj|fV  d S t	d|}|rN|dt
j| dfV  |dt| dfV  d S | t|fV  d S )Nr   zp\d+$z^(g?[aikSw])(\w+)      )rA   rerG   r   rD   r
   BuiltinrB   rE   searchr	   Type)rF   rG   r9   	nameMatchr/   r/   r0   name_callback   s   

z"CsoundOrchestraLexer.name_callbacklabelz
\b(\w+)(:)zpartial expressionr(   z$\b(0dbfs|k(r|smps)|nchnls(_i)?|sr)\br1   r2   r3   r   r   z\{\{zmulti-line stringu   [+\-*/%^!=&|<>#~¬]z	[](),?:[])doelseelseifendifenduntilfiifithenkthenodthenuntilwhilereturntimoutz\b)prefixsuffix)gotoigotokgotorigototigoto
goto label)cggotocigotocingotockgotocngoto)ri   goto expression)loop_geloop_gtloop_leloop_lt)ri   ro   ro   ro   z\bscoreline(_i)?\bzscoreline opcodez\bpyl?run[it]?\bzpython opcodez\blua_(exec|opdef)\b
lua opcodez\b[a-zA-Z_]\w*\b
expressionr'   r4   r7   z	\binstr\b)instrument blockinstrument name listz
\bopcode\b)opcode blockopcode parameter listopcode typesrz   opcode namerw   z\d+|\+?[a-zA-Z_]\w*,rv   z	\bendin\br   r{   z[a-zA-Z_]\w*rz   z0|[]afijkKoOpPStV[]+ry   rx   z	\bendop\br!   ro   r   z%\d*(\.\d+)?[cdhilouxX]z/%[!%nNrRtT]|[~^]|\\([\\aAbBnNrRtT"]|[0-7]{1,3})z[^\\"~$%\^\n]+z[\\"~$%\^\n]z\}\}z[^}]+|\}(?!\})	scorelinez([^}]+)|\}(?!\})pythonlua)r~   rt   r   N)&r)   r*   r+   r8   r9   r:   r;   setrB   rI   rQ   r   r
   Labelr   r   VariableGlobalr   r<   r=   r>   r   r   r   r	   rM   r?   r   rE   rO   InterpolEscaper   r   r   r   r.   r/   r/   r/   r0   r      sF   



$*4:BF
KOW
\bkpu
z 

 r   c                   @   s   e Zd ZdZdZddgZdgZe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   zW
    For `Csound <http://csound.github.io>`_ documents.

    .. versionadded:: 2.1
    zCsound Documentzcsound-documentz
csound-csdz*.csdr   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>]+)r7   r   r   r   r   r   N)r)   r*   r+   r8   r9   r:   r;   r?   r   r,   r   r
   Tagr   r   r   r   	Attributer   r.   r/   r/   r/   r0   r   :  sB    












r   )!r8   rL   pygments.lexerr   r   r   r   r   r   pygments.tokenr   r	   r
   r   r   r   r   r    pygments.lexers._csound_builtinsr   pygments.lexers.htmlr   pygments.lexers.pythonr   pygments.lexers.scriptingr   __all__Singler?   r   r   r   r   r/   r/   r/   r0   <module>   s   
 (B+ 3