lilypond-devel
[Top][All Lists]
Advanced

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

Re: Syntax change proposal:


From: Keith OHara
Subject: Re: Syntax change proposal:
Date: Wed, 25 Jul 2012 05:40:15 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

David Kastrup <dak <at> gnu.org> writes:

> >>>> One really ugly problem is interpreting things like "4.".  Looks like a
> >>>> duration, but then we have
> >>>> input/regression/dynamics-broken-hairpin.ly:  line-width = 4.\cm

The parser chooses among (too) many different modes ("start conditions") 
telling the lexer what kind of input to expect in the current context.
Floating-point numbers and note-durations appear in rather different 
situations. If both are valid in the same lexer modes, then maybe you can 
adjust the modes toward a smarter design.  

> Well, let's see what the parser currently delivers in INITIAL mode.
> 
> .     character .
> -.    REAL 0.0
> -.0   REAL -0.0
> -0.0  character - followed by 0.0
> 

> The semantics of -., for example, were introduced in 2.15.9 with
> commit da949cdcede0ffb559e9e5e2adbae2088ba1f6d6

I needed to interpret "\layout {indent = -.\mm}" without backing up in 
order to obey the instructions for changing lexer.ll while fixing issue 804.

I tested both interpretations, "staccato" or "0.0" (should have been -0.0)
 http://codereview.appspot.com/4871041/diff2/3001:8001/lily/lexer.ll
At the time, I did not foresee staccatos being valid in a \layout block.

If you expect to restrict REAL to -?[0-9]+(\.[0.9]+)? then I suggest you
switch back to interpreting \layout {indent = -.\mm } as a staccato before
the next stable release, or raise a bug and I'll do so.




reply via email to

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