o
    ‡ÎÖa!  ã                   @   s¾   d Z ddlZddlmZmZmZ ddl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mZ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 dgZ dZ!e!fd	d
„Z"G dd„ deƒZ#dS )zÈ
    pygments.lexers.lilypond
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Lexer for LilyPond.

    :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)ÚdefaultÚinheritÚwords)ÚSchemeLexer)ÚkeywordsÚpitch_language_namesÚclefsÚscalesÚrepeat_typesÚunitsÚchord_modifiersÚpitchesÚmusic_functionsÚdynamicsÚarticulationsÚmusic_commandsÚmarkup_commandsÚgrobsÚtranslatorsÚcontextsÚcontext_propertiesÚgrob_propertiesÚscheme_functionsÚpaper_variablesÚheader_variables)ÚTokenÚLilyPondLexerz(?=\d|[^\w\-]|[\-_][\W\d])c                 C   s@   d}|dkr|d7 }n|dkr|d7 }n|dksJ ‚t | ||ƒS )Nz[\-_^]?Ú	mandatoryz\\Úoptionalz\\?Ú
disallowed)r   )ÚnamesÚ	backslashÚsuffixÚprefix© r$   ú:/usr/lib/python3/dist-packages/pygments/lexers/lilypond.pyÚbuiltin_words   s   

r&   c                       sî  e Zd ZdZdZdgZdgZg Zej	ej
B Z‡ fdd„Zg dejf‘dejjf‘d	ejjf‘d
ejdf‘dejdf‘dejf‘eede d�ejf‘dejdf‘dejjf‘dejjf‘dejf‘dejf‘dejjjf‘dejjjf‘dejjjf‘eedƒej f‘ee!dƒejj"f‘ee#dƒejjj$f‘ee%dƒejjj&f‘ee'dƒejjj(f‘ee)dƒejf‘ee*dƒej+f‘ee,dƒejjj-f‘ee.dƒejjj/f‘ee0dƒejjjf‘ee1dƒejjj2f‘ee3dƒejjj4f‘ee5dƒejjj6f‘ee7dƒejjj8f‘ee9dƒejjj:f‘ee;dƒejjj<f‘ee=dƒejjj>df‘ee?dƒejjj@f‘eeAdƒejjjBf‘de ejjCf‘dejjDf‘d ejEf‘d!ejdfd"ejjFfd#ejfgd$ejd%feGgd&ejfdejfd'e ejjj>feHdƒgd(œZI‡  ZJS ))r   zâ
    Lexer for input to `LilyPond <https://lilypond.org>`_, a text-based music typesetter.

    .. important::

       This lexer is meant to be used in conjunction with the ``lilypond`` style.

    .. versionadded:: 2.11
    ÚLilyPondÚlilypondz*.lyc                 #   sl   � t ƒ  |¡D ],\}}}|tjju s|tjju r"|tv r!tjjj}n|tjju r-tjjj	}|||fV  qdS )z@Highlight Scheme variables as LilyPond builtins when applicable.N)
ÚsuperÚget_tokens_unprocessedr   ÚNameÚFunctionÚVariabler   ÚBuiltinÚSchemeFunctionÚSchemeBuiltin)ÚselfÚtextÚindexÚtokenÚvalue©Ú	__class__r$   r%   r*   B   s   €
€
úz$LilyPondLexer.get_tokens_unprocessedz\s+z	%\{.*?%\}z%.*?$z#\}ú#popz[#$]@?r5   z\\\\|--|[{}<>=.,:|]z=?[',]*!?\??)r"   z[\-_^]?"Ústringz
-?\d+\.\d+z	-?\d+/\d+z-?(\d+|\\longa|\\breve)\.*z\*z[~()[\]]z[\-_^][>^_!.\-+]z[\-_^]?\\?\d+r   r   r   úmaybe-subpropertiesz[\-_^]?\\.+?z$([^\W\d]|-)+(?=([^\W\d]|[\-.])*\s*=)Ú.ú"z\\.z[^\\"]+z#\{)r8   Úrootz\.z
([^\W\d])+)r=   r9   r5   r:   )KÚ__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesÚreÚDOTALLÚ	MULTILINEÚflagsr*   r   Ú
WhitespaceÚCommentÚ	MultilineÚSingleÚPunctuationr   r   ÚNAME_END_REÚPitchÚStringÚNumberÚFloatÚFractionr+   r.   ÚArticulationr&   r   ÚKeywordr   ÚPitchLanguager   ÚClefr	   ÚScaler
   Ú
RepeatTyper   r   ÚChordModifierr   ÚMusicFunctionr   ÚDynamicr   r   ÚMusicCommandr   ÚMarkupCommandr   ÚGrobr   Ú
Translatorr   ÚContextr   ÚContextPropertyr   ÚGrobPropertyr   ÚPaperVariabler   ÚHeaderVariableÚBackslashReferenceÚLvalueÚTextÚEscaper   r   ÚtokensÚ__classcell__r$   r$   r6   r%   r   &   sÆ    	þ
û
ø
õ
ðâ"Þ
%Û
(Ø
)×,Ô.Ò1Ï5Ë8È;Å<Ä=Ã>Â?Á@ÀA¿B¾C½E»FºG¹H¸I·KµL´Mþ³S­T¬X¨
\¤` 
c
ý
üüŽ)$rA   rF   Úpygments.lexerr   r   r   Úpygments.lexers.lispr   Ú"pygments.lexers._lilypond_builtinsr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Úpygments.tokenr   Ú__all__rO   r&   r   r$   r$   r$   r%   Ú<module>   s    
\
