David Wright <lily...@lionunicorn.co.uk> writes:

> I don't think this is the problem you think it is. It's actually
> myMusic = \relative c' { c4 d e f | } \myMusic
> where the definition of myMusic tries to eat itself.

Not really.  The parser wants to know from the lexer whether something
like \addlyrics is after the closing brace before committing to an
assignment.  And the lexer decides about what kind of token \myMusic is
after looking at the type of myMusic.  Which isn't defined yet.

It could just say "it's not \addlyrics, I can tell you as much as that"
but when splitting information into two such pieces, it becomes two
tokens, and the parser has a number of points where it needs one token
of lookahead to make decisions, and when that token is just "it's not
\addlyrics", this is not enough.

So no: the definition of myMusic would not need to eat itself, but
parser and lexer's information exchange somehow causes this hen-and-egg
problem that logic would not require.

In short: technical reasons.

David Kastrup

lilypond-user mailing list

Reply via email to