a
    ;@b!                     @   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s4J t | ||S )Nz[\-_^]?	mandatoryz\\optionalz\\?
disallowed)r   )namesZ	backslashsuffixprefix r#   7lib/python3.9/site-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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g%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
    ZLilyPondZlilypondz*.lyc                 #   sj   t  |D ]X\}}}|tjju s.|tjju rB|tv rXtjjj}n|tjju rXtjjj	}|||fV  qdS )z@Highlight Scheme variables as LilyPond builtins when applicable.N)
superget_tokens_unprocessedr   NameZFunctionZVariabler   BuiltinZSchemeFunctionZSchemeBuiltin)selftextindextokenvalue	__class__r#   r$   r'   B   s    
z$LilyPondLexer.get_tokens_unprocessedz\s+z	%\{.*?%\}z%.*?$z#\}#popz[#$]@?r.   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#\{)r1   rootz\.z
([^\W\d])+)r6   r2   r.   r3   )K__name__
__module____qualname____doc__namealiases	filenamesZ	mimetypesreDOTALL	MULTILINEflagsr'   r   
WhitespaceCommentZ	MultilineSingleZPunctuationr   r   NAME_END_REZPitchStringNumberZFloatZFractionr(   r)   ZArticulationr%   r   ZKeywordr   ZPitchLanguager   ZClefr	   ZScaler
   Z
RepeatTyper   r   ZChordModifierr   ZMusicFunctionr   ZDynamicr   r   ZMusicCommandr   ZMarkupCommandr   ZGrobr   Z
Translatorr   ZContextr   ZContextPropertyr   ZGrobPropertyr   ZPaperVariabler   ZHeaderVariableZBackslashReferenceZLvalueTextZEscaper   r   tokens__classcell__r#   r#   r/   r$   r   &   sz   	







c


)$r:   r>   Zpygments.lexerr   r   r   Zpygments.lexers.lispr   Z"pygments.lexers._lilypond_builtinsr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Zpygments.tokenr   __all__rE   r%   r   r#   r#   r#   r$   <module>   s   
\
