Am 26.11.22 um 18:35 schrieb Lukas-Fabian Moser:
Am 26.11.22 um 18:11 schrieb David Kastrup:
\override NoteHead.color = red
actually lowers the barrier immensely compared with
\override NoteHead #'color = #red
red and #red are completely different Scheme entities.
Yes indeed (I suspect
Am 26.11.22 um 18:11 schrieb David Kastrup:
\override NoteHead.color = red
actually lowers the barrier immensely compared with
\override NoteHead #'color = #red
red and #red are completely different Scheme entities.
Yes indeed (I suspect red gets parsed to #'red, no?). I never took the
Lukas-Fabian Moser writes:
> \override NoteHead.color = red
>
> actually lowers the barrier immensely compared with
>
> \override NoteHead #'color = #red
red and #red are completely different Scheme entities.
> - of course that's more than one syntax simplificiation here, but it
> shows how
Hi Jean,
FWIW, the last one
a4_boringly
is something I wouldn't do, since
a_boringly
does not work
Yes, d'accord.
Personally, I tend to leave out # when possible for numbers,
and also leave out #' for symbols when possible because it
is not only shorter, but allows the syntax
Jean Abou Samra writes:
>> \version "2.23.10"
>>
>> \removeWithTag dyn \new Staff = upper {
>> \tag dyn <>\mf
>> \ottava -1
>> a4_boringly
>> }
>>
>> But of course there's always the danger of beginners tripping up on
>> this because they do not recognise the situations where #/'/"" are
>>
Le 26/11/2022 à 16:16, Werner LEMBERG a écrit :
OK, but where exactly is this documented? Is this missing, or am I
blind?
I think it's not written anywhere.
If it is missing, could a Scheme expert please write some
lines that I could incorporate into an MR?
Nothing complicated: If a
>>> Are there still cases where `#` is mandatory for numbers?
>>> Otherwise the documentation could be updated to remove all `#`.
>>
>> Yes, there are: In markup, for example.
>>
>> \markup \fontsize 3 Hi
>>
>> is still illegal.
OK, but where exactly is this documented? Is this missing, or am I
Le 26/11/2022 à 11:32, Lukas-Fabian Moser a écrit :
Hi Werner,
In the NR, most such functions have its argument starting with `#`,
for example
```
\ottava #-2
```
Are there still cases where `#` is mandatory for numbers? Otherwise
the documentation could be updated to remove all `#`.
Hi Werner,
In the NR, most such functions have its argument starting with `#`,
for example
```
\ottava #-2
```
Are there still cases where `#` is mandatory for numbers? Otherwise
the documentation could be updated to remove all `#`.
Yes, there are: In markup, for example.
\markup
>> However,
>>
>> \musicFunction 4
>>
>> could be an integer or a duration, and
>>
>> \musicFunction -4
>>
>> could be an integer or a fingering, depending on how musicFunction
>> is defined, [...]
>
> Thanks, I didn't think of music functions.
In the NR, most such functions have its argument
>> Why not. If you want to be even more precise on what you want to
>> match:
>>
>> -\d+|((\d+|\\breve|\\longa)\.*)
>
> if someone really wants to touch that, please note that \maxima too
> is a duration.
Indeed, this is missing. I will add this to my work that will
eventually result in a PR
Le 25/11/2022 à 20:28, Luca Fascione a écrit :
On Fri, 25 Nov 2022, 18:11 Jean Abou Samra, wrote:
What makes you think Pygments can’t do this? You can do
(?<=\w+)\d+
Nothing but my not remembering lookaheads/lookbehinds, which I may
argue aren't very commom constructs. In fact
Jean Abou Samra ezt írta (időpont: 2022. nov.
25., P, 18:05):
> > Le 25 nov. 2022 à 17:54, Werner LEMBERG a écrit :
> > OK, but shouldn't this be rather
> > (-?\d+|\\longa|\\breve)\.*
> > then?
>
> Why not. If you want to be even more precise on what you want to match:
>
>
On Fri, 25 Nov 2022, 18:11 Jean Abou Samra, wrote:
> What makes you think Pygments can’t do this? You can do
>
> (?<=\w+)\d+
>
Nothing but my not remembering lookaheads/lookbehinds, which I may argue
aren't very commom constructs. In fact aside from PERL I'm not even sure
what precedent they
>> The thing is that the regular expressions match both LilyPond and
>> Scheme syntax.
>
> Uh? No they don’t, look at SchemeLexer and its horrendous regexes to
> parse numbers (also written by yours truly).
Thanks for the correction; this makes adjusting the regular
expressions simpler :-)
>
> Le 25 nov. 2022 à 18:03, Luca Fascione a écrit :
>
> It's not a validation, it's an anchor, it avoids it matching other numbers.
> That's why the capture. If pygments was better designed it'll let you do
> semi-context-sensitive
> stuff like this, so you could say "numbers, but only if the
> Le 25 nov. 2022 à 17:54, Werner LEMBERG a écrit :
>
>
>>
>>> Note that at the time this regex is active, numbers are taken care
>>> of.
>>
>> Floats are, integers not.
>
> OK, but shouldn't this be rather
>
> ```
> (-?\d+|\\longa|\\breve)\.*
> ```
>
> then?
Why not. If you want to
I agree this would be a better regex, yes.
(You still have that double re: thing in the subject going on, Werner)
L
On Fri, 25 Nov 2022, 17:55 Werner LEMBERG, wrote:
> >> Note that at the time this regex is active, numbers are taken care
> >> of.
> >
> > Floats are, integers not.
>
> OK, but
It's not a validation, it's an anchor, it avoids it matching other numbers.
That's why the capture.
If pygments was better designed it'll let you do semi-context-sensitive
stuff like this, so you could say "numbers, but only if the follow a note
name" -> durations
L
On Fri, 25 Nov 2022, 17:52
> Le 25 nov. 2022 à 17:52, Werner LEMBERG a écrit :
>
>
>> well -3 seems to be matching it, (say in a-3, I'm aware this is a
>> fingering/articulation mark, not a duration). It appears to be an
>> attempt to match a signed integer followed by zero or more dots.
>
> The thing is that the
> Le 25 nov. 2022 à 17:16, Luca Fascione a écrit :
> well -3 seems to be matching it, (say in a-3, I'm aware this is a
> fingering/articulation mark, not a duration).
> It appears to be an attempt to match a signed integer followed by zero or
> more dots.
>
> It sucks that pygments regexes
>> Note that at the time this regex is active, numbers are taken care
>> of.
>
> Floats are, integers not.
OK, but shouldn't this be rather
```
(-?\d+|\\longa|\\breve)\.*
```
then?
Werner
> well -3 seems to be matching it, (say in a-3, I'm aware this is a
> fingering/articulation mark, not a duration). It appears to be an
> attempt to match a signed integer followed by zero or more dots.
The thing is that the regular expressions match both LilyPond and
Scheme syntax.
> It sucks
well -3 seems to be matching it, (say in a-3, I'm aware this is a
fingering/articulation mark, not a duration).
It appears to be an attempt to match a signed integer followed by zero or
more dots.
It sucks that pygments regexes are context free, though.
This should be using regex capturing and be
Le 25/11/2022 à 14:23, Werner LEMBERG a écrit :
Note that at the time this regex is active,
numbers are taken care of.
Floats are, integers not.
Jean
OpenPGP_signature
Description: OpenPGP digital signature
Looking into `lilypond.py` (in `pygments.zip`), I wonder what exactly
this regex does:
```
# Integer, or duration with optional augmentation dots. We have no
# way to distinguish these, so we highlight them all as numbers.
(r"-?(\d+|\\longa|\\breve)\.*", Token.Number),
```
What is `-?` good
26 matches
Mail list logo