lilypond-devel
[Top][All Lists]
Advanced

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

Re: Allow digits in identifiers (issue 6493072)


From: David Kastrup
Subject: Re: Allow digits in identifiers (issue 6493072)
Date: Wed, 05 Sep 2012 17:12:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Bernard Hurley <address@hidden> writes:

> On Mon, Sep 03, 2012 at 08:07:07PM +0000, address@hidden wrote:
>>
>> flex documentation is pretty clear about backing up being very
>> expensive.  I don't remember whether it was only expensive when it
>> happens, or whether the expense was more or less a fixed cost.  However,
>> things like a4 are not actually rare in music input.
>>
>
> Would there be any future in allowing digits in identifiers provided
> the sequence started with a 0. So a04 would be an identifier but
> a4 not. This seems to avoid the backing up problem.

Not really: the lexer does not even recognize durations.  That is the
prerequisite of the parser.

Here is another "cure" for that request: if we can get used to writing
"violin1" = { ... }
for defining a name with numbers in it, it would be an obvious syntax
extension to allow its invocation as

\"violin1"

A somewhat non-obvious disadvantage is that this is likely to confuse
the syntax highlighting of editors used to C-like strings, since \" is
not a string delimiter at least inside of C strings, and so it might not
be considered a string starter.

-- 
David Kastrup




reply via email to

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