is_main_input reflects the state of being in the reign of the main
input file as opposed to the init file, which corresponds to a drop of
privileges. This drop of privileges is explicitly signified with
\maininput
and should not otherwise be tampered with in order not to restrict the
init file's capabilities. There should be no way to arrive at a lexer
from within LilyPond or Scheme without is_main_input_ set unless one
already has one such lexer to start with.
<INITIAL,chords,lyrics,notes,figures>\\maininput {
- if (!is_main_input_)
+ if (!is_main_input_ && include_stack_.size () == 1)
{
start_main_input ();
is_main_input_ = true;
Lily_parser::parse_string (string ly_code)
{
lexer_->main_input_name_ = "<string>";
- lexer_->is_main_input_ = true;
lexer_->new_input (lexer_->main_input_name_, ly_code, sources_);
SCM mod = lexer_->set_current_scope ();
int line)
{
lexer_->main_input_name_ = filename;
- lexer_->is_main_input_ = true;
lexer_->new_input (lexer_->main_input_name_, ly_code, sources_);
if (line)
{