lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange pygments handling of LilyPond input,Re: strange pygments han


From: Werner LEMBERG
Subject: Re: strange pygments handling of LilyPond input,Re: strange pygments handling of LilyPond input
Date: Wed, 02 Nov 2022 15:19:15 +0000 (UTC)

>> ```
>> c''4-3 e-5 b-2 a-1
>> ```
>>
>> which Pygments translates to
>>
>> ```
>> @t{c''} @t{4} @t{-3} @t{e} @t{-5} @t{b} @t{-2} @t{a} @t{-1}
>> ```
>>
>> that is, the `-` is not typeset in bold.
>
> Because "-3" could just as well be a number rather than a fingering,
> and it's hard to guess.
>
>> The next one
>> ```
>> c''4-ˆ c-+ c-- c-!
>> ```
>>
>> gets translated to
>>
>> ```
>> @t{c''} @t{4} @tb{-^} @t{c} @tb{-+} @t{c} @t{--} @t{c} @tb{-!}
>>                                            ^^^^^^
>> ```
>>
>> showing bold and non-bold for `-` in the same function.
>
> Because "--" could be a lyric hyphen.

OK, thanks.  I wonder how the heuristics could be improved.  Given
that a lyric hyphen must be preceded by whitespace, while normally
`--` as an articulation is following a non-whitespace character, maybe
a look-behind assertion for the latter would help?  Something similar
could be done for numbers.


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]