lilypond-user
[Top][All Lists]
Advanced

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

Re: cannot run ../.ly file which includes another file


From: David Kastrup
Subject: Re: cannot run ../.ly file which includes another file
Date: Fri, 13 Apr 2018 22:11:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

David Wright <address@hidden> 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



reply via email to

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