3

V'íc&ã@sÂdZddlZddlmZmZmZmZddlmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlm Z dgZ!dZ"e"fd	d
„Z#Gdd„deƒZ$dS)zÈ
    pygments.lexers.lilypond
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Lexer for LilyPond.

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
éN)ÚbygroupsÚ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])cCs@d}|dkr|d7}n|dkr(|d7}n|dks4t‚t|||ƒS)Nz[\-_^]?Ú	mandatoryz\\Úoptionalz\\?Ú
disallowed)ÚAssertionErrorr)ÚnamesZ	backslashÚsuffixÚprefix©r%ú</tmp/pip-build-gk9425m9/Pygments/pygments/lexers/lilypond.pyÚ
builtin_words$s

r'c's¸eZdZdZdZdZdgZdgZgZe	j
e	jBZ‡fdd„Z
dejjfd	ejjfd
ejjfdejdfd
ejdfdejfeededejfdejdfdejjfdejjfdejfdejfdejjjfdejjjfdejjjfe e!dƒej"fe e#dƒejj$fe e%dƒejjj&fe e'dƒejjj(fe e)dƒejjj*fe e+dƒejfe e,dƒej-fe e.dƒejjj/fe e0dƒejjj1fe e2dƒejjjfe e3dƒejjj4fe e5dƒejjj6fe e7dƒejjj8fe e9dƒejjj:fe e;dƒejjj<fe e=dƒejjj>fe e?dƒejjj@dfe eAdƒejjjBfe eCdƒejjjDfdeejjEfd ejjFfd!eejfd"ejfg&d#ejdfd$ejjGfd%ejfgd&ejd*feHgdejjfd(eeIejejjj@ƒfeJdƒgd)œZK‡ZLS)+rzÈ
    Lexer for input to LilyPond, a text-based music typesetter.

    .. important::

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

    .. versionadded:: 2.11
    ZLilyPondzhttps://lilypond.orgZlilypondz*.lyc#snxhtƒj|ƒD]X\}}}|tjjks0|tjjkrD|tkrZtjjj}n|tjjkrZtjjj	}|||fVqWdS)z@Highlight Scheme variables as LilyPond builtins when applicable.N)
ÚsuperÚget_tokens_unprocessedrÚNameZFunctionÚVariablerÚBuiltinZSchemeFunctionZ
SchemeBuiltin)ÚselfÚtextÚindexÚtokenÚvalue)Ú	__class__r%r&r)Ls
z$LilyPondLexer.get_tokens_unprocessedz\s+z	%\{.*?%\}z%.*?$z#\}ú#popz[#$]@?r1zm(?x)
               \\\\
               | (?<= \s ) (?: -- | __ )
               | [{}<>=.,:|]
              z=?[',]*!?\??)r#z[\-_^]?"Ústringz
-?\d+\.\d+z	-?\d+/\d+zŠ(?x)
               (?<= \s ) -\d+
               | (?: (?: \d+ | \\breve | \\longa | \\maxima )
                     \.* )
              z\*z[~()[\]]z[\-_^][>^_!.\-+]z
[\-_^]?\\?\d+rr rzmaybe-subpropertiesz[\-_^]?\\.+?zg(?x)
               (?: [^\W\d] | - )+
               (?= (?: [^\W\d] | [\-.] )* \s* = )
              z
([^\W\d]|-)+?Ú.ú"z\\.z[^\\"]+z#\{Úrootz(\.)((?:[^\W\d]|-)+?))r7r4r1zmaybe-subproperties)r3r7)MÚ__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚurlÚaliasesÚ	filenamesÚ	mimetypesÚreÚDOTALLÚ	MULTILINEÚflagsr)rZTextÚ
WhitespaceÚCommentZ	MultilineÚSingleZPunctuationrrÚNAME_END_REZPitchÚStringÚNumberZFloatZFractionr*r,ZArticulationr'rÚKeywordrZ
PitchLanguager	ZClefr
ZScalerZ
RepeatTyperr
Z
ChordModifierrZ
MusicFunctionrZDynamicrrZMusicCommandrZ
MarkupCommandrZGrobrZ
TranslatorrÚContextrZContextPropertyrZGrobPropertyrZ
PaperVariablerZHeaderVariableZBackslashReferenceZLvalueZEscaperrrÚtokensÚ
__classcell__r%r%)r2r&r/sr	
















)%r;rAZpygments.lexerrrrrZpygments.lexers.lisprZ"pygments.lexers._lilypond_builtinsrrr	r
rrr
rrrrrrrrrrrrrrZpygments.tokenrÚ__all__rHr'rr%r%r%r&Ú<module>	s\