On 2/10/10 9:16 PM, "Michael J. O'Donnell" <michael_odonn...@acm.org> wrote:

> 
> I have been hunting, so far in vain, for the code implementing \include,
> in the hope that I can tweak that code to get the right behavior.

It appears to me that \include is implemented in two places:

1) lily/lexer.ll, lines 304-336

2) lily/lily-lexer.cc, lines 255-271

Now, please understand that I'm not at all an expert on the parser/lexer of
LilyPond.  But I think that lexer.ll calls new_input, and lily-lexer.cc
defines new-input.

lily-lexer.ll is where the file identifier is extracted (lexed?), and would
be an ideal place to see if the include has already been processed, if the
necessary variable structure is available.

lily-lexer.cc is where the input file is actually opened (and the file name
exists there, as well).  This is where the input is aborted if safe mode is
running, so it might also be a place to check for definition of a
variable...

HTH,

Carl



_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to