a
    ñ»jnB  ã                   @   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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„ 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-present 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                   @   sø  e Zd ZdZdefdejfdejfdee	eƒfg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edƒdedfgedƒdedfgdefedƒdeej
eƒdfdej
dfgedƒdej
fdefdedfgdefedƒdedfgdej
fdej
fdedfgedƒdej
dfgd eej
eƒd!fd"ej
fg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)ej
fd*efed+ƒgd)ej
fd*efed,ƒgd-ej
fd'ej
d.fdej
dfgedƒed/ƒgd0ejfd1eejejƒfd2ejfgdedfd3efed/ƒd4efgg d5œZd6S )7ÚCsoundLexerzhttps://csound.com/z[ \t]+ú/[*][\s\S]*?[*]/ú(?:;|//).*$z(\\)(\n)z)#(?:e(?:nd(?:if)?|lse)\b|##)|@@?[ \t]*\d+z#includestrúincludestr directivez#includeúinclude directivez#[ \t]*defineúdefine directivez#(?:ifn?def|undef)\búmacro directiveÚ
whitespacez([^ \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 bodyz['#]z\)ú#)r#   ú
macro bodyz(?:\\(?!#)|[^#\\]|\n)+z\\#z(?<!\\)#z(\$[A-Z_a-z]\w*\.?)(\()úmacro parameter value listz\$[A-Z_a-z]\w*(?:\.|\b)z(?:[^\'#"{()]|\{(?!\{))+ú#macro parameter value quoted stringú\{\{ú#macro parameter value braced stringz\(ú#macro parameter value parentheticalz\\[#'()]z[#'()]r%   úbraced stringz(?:[^\\()]|\\\))+z#pushú
macro usesz2\d+[Ee][+-]?\d+|(\d+\.\d*|\d*\.\d+)([Ee][+-]?\d+)?z(0[Xx])([0-9A-Fa-f]+)ú\d+z[^"$]+z[$])r"   úpreprocessor directivesr   r   r    r'   r)   r+   r!   r2   r,   r-   r/   r0   úwhitespace and macro usesÚnumbersr%   r1   N)Ú__name__Ú
__module__Ú__qualname__Úurlr   r   Ú	MultilineÚSingler   r   ÚPreprocr   r   r   r	   r   ÚFloatr
   ÚTypeÚHexÚIntegerÚtokens© rC   rC   ú<E:\soccer\ml_env\Lib\site-packages\pygments/lexers/csound.pyr      sž   ü



û	þþÿ
ûüýý
þÿý
ú	ýý

ýþýü›r   c                   @   sæ   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&   r5   r4   z[aBbCdefiqstvxy]Úzz([nNpP][pP])(\d+)z[mn]úmark statementr6   z[!+\-*/^%&|<>#~.]z[()\[\]]r$   r%   z\{úloop after left bracer(   r#   r3   )r#   úloop after repeat count)r#   Úloopz\}Úrootú\}\}z[^}]|\}(?!\}))rK   rG   rH   rI   rJ   r1   N)r7   r8   r9   Ú__doc__ÚnameÚaliasesÚ	filenamesÚversion_addedr   r   r
   ÚConstantr   r   rA   r   r   r   r   r=   r   ÚLabelrB   rC   rC   rC   rD   r   ˆ   sF   
éý
þ
þ
þþÐr   c                   @   s  e Zd ZdZdZddgZddgZdZeƒ Z	dd	„ Z
d
d„ Z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ejjfedƒdefdefdedfdedfedddd �efed!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d0fd1ejd2fd3ejjfd4efgedƒd5ejfd6efded7fgedƒd8e
d9fded7fgedƒd:ejfd;efded7fgded7fd<efed=ƒed>ƒed?ƒd@efgdAed7fdBefed>ƒed?ƒdCefgdDejfgdEejfdFejfgedƒd;ed7fedƒgedƒdGejd7fe d7ƒgedƒdedHfe d7ƒgdIejfdJejfedƒgedƒdedfdedKfded7fgdAed7fdLe!e"ƒfgedƒdedfdedMfded7fgdAed7fdLe!e#ƒfgedƒdedfdedNfded7fgdAed7fdLe!e$ƒfgdOœZ%dPS )Qr   z8
    For `Csound <https://csound.com>`_ orchestras.
    zCsound OrchestraÚcsoundz
csound-orcz*.orcz*.udorE   c                 c   s,   |  d¡}| j |¡ | ¡ tj|fV  d S )Nr   )ÚgroupÚuser_defined_opcodesÚaddÚstartr   ÚFunction)ÚlexerÚmatchÚopcoderC   rC   rD   Úopcode_name_callbackÕ   s    
z)CsoundOrchestraLexer.opcode_name_callbackc                 c   sð   t j}| d¡}|tv s(|tv s(|tv r<| ¡ tj|fV  nv|| j	v rZ| ¡ tj
|fV  nXt}t d|¡}|r¢| d¡t j| d¡fV  | d¡t| d¡fV  n| ¡ t|fV  | d¡rì| d¡t| d¡fV  | d¡|| d¡fV  d S )Né   z^(g?[afikSw])(\w+)é   é   )r
   r?   rU   r   r   r   rX   r   ÚBuiltinrV   rY   ÚreÚsearchr   )rZ   r[   Ztype_annotation_tokenrN   Z
name_matchrC   rC   rD   Úname_callbackÚ   s    


z"CsoundOrchestraLexer.name_callbackr&   z^([ \t]*)(\w+)(:)([ \t]+|$)r5   r4   z	\binstr\bú"instrument numbers and identifiersz
\bopcode\búafter opcode keywordz\b(?:end(?:in|op))\búpartial statementsz-\b(?:0dbfs|A4|k(?:r|smps)|nchnls(?:_i)?|sr)\br6   u@   \+=|-=|\*=|/=|<<|>>|<=|>=|==|!=|&&|\|\||[~Â¬]|[=!+\-*/^%&|<>#?:]z	[(),\[\]]r$   r%   r.   r1   )ÚdoÚelseZelseifÚendifZenduntilÚfiÚifZithenZkthenZodZthenZuntilÚwhilez\b)ÚprefixÚsuffix)ÚreturnZrireturnz\b[ik]?goto\bú
goto labelz"\b(r(?:einit|igoto)|tigoto)(\(|\b)z\b(c(?:g|in?|k|nk?)goto)(\(|\b))rq   úgoto argumentz\b(timout)(\(|\b))rq   rr   rr   z\b(loop_[gl][et])(\(|\b))rq   rr   rr   rr   z\bprintk?s\búprints opcodez"\b(?:readscore|scoreline(?:_i)?)\búCsound score opcodez\bpyl?run[it]?\bú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 signaturesz0|[afijJkKoOpPStV\[\]]+ú,z
[^\\"$%)]+r2   úescape sequencesúformat specifiersz[\\$%)]rL   z(?:[^\\%)}]|\}(?!\}))+z[\\%)]z\\(?:[\\abnrt"]|[0-7]{1,3})z'%[#0\- +]*\d*(?:\.\d+)?[AE-GXac-giosux]z%%z\w+úprints quoted stringz\\\\[aAbBnNrRtT]z%[!nNrRtT]|[~^]{1,2}úCsound scorez([^}]+)|\}(?!\})ÚPythonÚLua)rK   rg   re   rf   rw   r%   r1   ry   rz   rr   rq   rs   r{   rt   r|   ru   r}   rv   r~   N)&r7   r8   r9   rM   rN   rO   rP   rQ   ÚsetrV   r]   rd   r   r   r   rS   r   r   r
   ÚDeclarationÚVariableÚGlobalr   r   r   ÚPseudora   ÚInstancerY   r?   ÚEscapeÚInterpolr   r   r   r   r   rB   rC   rC   rC   rD   r   É   sö   

ô
ýýÿÿÿÿ




à$üýùú	û	þþý
ýýýü
þü
þü
þ€ Ür   c                   @   sö   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.comrE   r   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'([\s\S])+?(?=<\s*/\s*CsInstruments\s*>)z<\s*/\s*CsScore\s*>z!([\s\S])+?(?=<\s*/\s*CsScore\s*>)z<\s*/\s*[Hh][Tt][Mm][Ll]\s*>z*([\s\S])+?(?=<\s*/\s*[Hh][Tt][Mm][Ll]\s*>)z\s+z[\w.:-]+\s*=Úattrz/?\s*>z".*?"z'.*?'z[^\s>]+)rK   r‡   r‰   rŠ   rˆ   r‹   N)r7   r8   r9   rM   rN   rO   rP   r:   rQ   r   r;   r<   r   r   ÚTagr   r   r   r   r   Ú	Attributer   rB   rC   rC   rC   rD   r   š  sD   



ö

þ

þ

þ

ýüàr   )%rM   rb   Zpygments.lexerr   r   r   r   r   r   Zpygments.tokenr   r	   r
   r   r   r   r   r   r   r   Z pygments.lexers._csound_builtinsr   r   r   Zpygments.lexers.htmlr   Zpygments.lexers.pythonr   Zpygments.lexers.scriptingr   Ú__all__r<   Únewliner   r   r   r   rC   rC   rC   rD   Ú<module>   s   
 0nA R