bug-lilypond
[Top][All Lists]
Advanced

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

Re: Issue 1670 in lilypond: Allow numbers in variable names: violin1mvt2


From: Keith OHara
Subject: Re: Issue 1670 in lilypond: Allow numbers in variable names: violin1mvt2 = c'
Date: Sun, 29 May 2011 20:53:16 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

> Comment #6 on issue 1670 by address@hidden: Allow numbers in  
> variable names: violin1mvt2 = c'
>
> Our language has a well-defined rule for variables: letters only.

Just to be pedantic:
  letters only, and not a note-name in the current input language.

Actually, you can use a note-name, like dis, if you put quotes around it in its 
definition: "dis" = {...}.  (Accented characters are also accepted, but that's 
not documented an probably not a good idea either.)


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

> The language should strive to be simple enough to be understandable to
> simple local parsers, 

Yep, but LilyPond is not simple.
The vi syntax highlighter does an impressive job:
  \violin = \afterGrace a b h = c
correctly has the h highlighted as a variable, presumably by look-ahead to the 
'=', without vi knowing if I speak German.

The LilyPond parser interprets \afterGrace to learn what arguments it needs, so 
it can parse them.  Maybe the parser it could tell the lexer that it is ready 
for another top-level expression before reading the 'h', but I could not make 
it do so early enough.  

In hindsight, the simpler language would require braces around a music 
expression.  That is, do not allow
  \transpose c d e1
but require 
  \transpose c d { e1 }





reply via email to

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