On 10/12/10 9:28 PM, "Graham Percival" <gra...@percival-music.ca> wrote:

> On Tue, Oct 12, 2010 at 05:17:44PM +0100, Phil Holmes wrote:
>> <percival.music...@gmail.com> wrote in message
>> news:0016e6435382308cfc04925d9...@google.com...
>>> On 2010/10/11 18:18:37, dak wrote:
>>>> python/convertrules.py:2992: _ ("\\RemoveEmpty*StaffContext -> \*Staff
>>>> \\RemoveEmptyStaves"))
>>>> Any particular reason that \*Staff does not get the backslash doubled
>>> as well?
>>> 
>>> The reason was that I didn't know what \* did -- I'm guessing it has a
>>> special meaning in regex -- so I thought I should leave it alone.
>> 
>> * has a special meaning in a regex - repeat the preceding class zero
>> or more times - so it has to be escaped with a backslash in a regex.
> 
> Thanks!
> 
> So that's a good reason to avoid writing \\*Staff -- we don't want
> a literal \ in the output, and we do want a literal *Staff.

Actually, I think in this case we *do* want a literal \ in the output, and a
literal *Staff.

IIUC, this is *not* a regex, it's a (human-readable) description of the
changes to be made.  It should read:

\RemoveEmpty*StaffContext -> \*Staff \RemoveEmptyStaves

The * is meant to be a substitute for nothing, Tab, Drum, Choir, Piano,
Rhythmic, etc.  It's supposed to be like an argument to the ls command.

Doubling up the backslash should make it work properly, I think.

Thanks,

Carl


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to