]> git.donarmstrong.com Git - lilypond.git/commit
Issue 2939: Fix relations between \maininput, EOF and safe mode
authorDavid Kastrup <dak@gnu.org>
Wed, 31 Oct 2012 11:33:15 +0000 (12:33 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 5 Nov 2012 13:56:47 +0000 (14:56 +0100)
commita68e2f12c41ddbf91bbea15f345d0eb37bd87e69
tree66d40ec71c4ac54471e174b5a8aa76da66996e74
parentb293e2046fc5a4cedf01d602c77b55ff41376735
Issue 2939: Fix relations between \maininput, EOF and safe mode

In lexer.ll, assumptions about the depth of include_stack_ were hardwired
that only were valid for parsers started from the normal chain of input.

One consequence was that something like

    #{ \book { \include "line-arrows.ly" } #}

worked even in safe mode (where \include should be prohibited) but
might complain about unexpected EOF.  This commit adds a member
variable main_input_level to Lily_lexer for keeping track of when to
drop restrictions and deliver EOF in each parser separately.
lily/include/lily-lexer.hh
lily/lexer.ll
lily/lily-lexer.cc