[Top][All Lists]

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

Re: convert-ly rules: word boundaries

From: John Mandereau
Subject: Re: convert-ly rules: word boundaries
Date: Mon, 06 Jul 2009 23:14:13 +0200

Le samedi 04 juillet 2009 à 01:58 -0700, Graham Percival a écrit :
> arpeggio* should have \\ as well.  Also, they should also be
> matched with full words.  In fact, 99% of the convert-ly rules
> need to match a complete word.  According to Daniel Hulme,
> "\\octave\b" would work fine.
> 1)  Could somebody verify this (look in the python docs, run a few
> tests, whatever... not that I doubt Daniel; just that we should
> make sure).

I agree on Python bits, but how can you be sure about the 99%?  If we go
for checking every old rule, this job must be split between several
people as it is quite huge: for many rules you should check whether the
word is used in some grob or context property name, and I'm sure to
remember that some rules purposely don't use regexp with word boundary
mathching to match a set of several words with a common subword in just
one expression etc...

> 2)  Could somebody consider writing a nicely-named-function such
> that the convert-ly rules look like this?
> def conv (str):
>     str = f("\\oldCommand", "\\newCommand", str)
> ?
> It's silly for people to manually add \b everywhere, and it's
> equally silly for contributors to say "oh, I can't touch
> convert-ly, since I don't know python".  Let's make it easy to
> write/modify those rules.

Agreed, but I can't promise anything for this, I have way much more to
do for LilyPond (and a little for texi2html) than I'm able to complete
until the end of the month.


reply via email to

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