[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pygment regex question
From: |
Jean Abou Samra |
Subject: |
Re: pygment regex question |
Date: |
Fri, 25 Nov 2022 18:11:28 +0100 |
> Le 25 nov. 2022 à 18:03, Luca Fascione <l.fascione@gmail.com> 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 follow a note
> name" -> durations
What makes you think Pygments can’t do this? You can do
(?<=\w+)\d+
and things like that. You could also arrange so that the regex parsing a pitch
leaves you in a state of the lexer where something special will happen for \d+.
However, durations don’t always follow a pitch, as in
\tuplet 3/2 8. { … }
which is the reason why we don’t want to do that.
- pygment regex question, Werner LEMBERG, 2022/11/25
- Re: pygment regex question, Jean Abou Samra, 2022/11/25
- Re: pygment regex question,Re: pygment regex question, Werner LEMBERG, 2022/11/25
- Re: pygment regex question,Re: pygment regex question, Luca Fascione, 2022/11/25
- Re: pygment regex question,Re: pygment regex question, Jean Abou Samra, 2022/11/25
- Re: pygment regex question,Re: pygment regex question, Benkő Pál, 2022/11/25
- Re: pygment regex question,Re: pygment regex question, Werner LEMBERG, 2022/11/26
Re: pygment regex question, Luca Fascione, 2022/11/25
Re: pygment regex question, Jean Abou Samra, 2022/11/25
Re: pygment regex question, Werner LEMBERG, 2022/11/25
Re: pygment regex question, Werner LEMBERG, 2022/11/26
Re: pygment regex question, Lukas-Fabian Moser, 2022/11/26
Re: pygment regex question, Jean Abou Samra, 2022/11/26
Re: pygment regex question,Re: pygment regex question, Werner LEMBERG, 2022/11/26
Re: pygment regex question,Re: pygment regex question, Jean Abou Samra, 2022/11/26
Re: pygment regex question, David Kastrup, 2022/11/26