From fb17810c8cc05b3452e0f489b330b262cbc479c3 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 21:45:03 +0000 Subject: [PATCH] lilypond-1.1.13 --- lily/includable-lexer.cc | 9 ++++++++- lily/include/includable-lexer.hh | 2 ++ lily/include/main.hh | 2 ++ lily/main.cc | 7 +++++++ lily/music-output-def.cc | 5 +++-- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lily/includable-lexer.cc b/lily/includable-lexer.cc index 1adf85425d..45607f77ee 100644 --- a/lily/includable-lexer.cc +++ b/lily/includable-lexer.cc @@ -25,6 +25,7 @@ Includable_lexer::Includable_lexer () { yy_current_buffer = 0; + allow_includes_b_ = true; } /** set the new input to s, remember old file. @@ -32,6 +33,12 @@ Includable_lexer::Includable_lexer () void Includable_lexer::new_input (String s, Sources * global_sources) { + if (!allow_includes_b_) + { + LexerError ("include files are disallowed."); + return; + } + Source_file * sl = global_sources->get_file_l (s); if (!sl) { @@ -44,7 +51,7 @@ Includable_lexer::new_input (String s, Sources * global_sources) char_count_stack_.push (0); if (yy_current_buffer) state_stack_.push (yy_current_buffer); - *mlog << "[" << s< char_count_stack_; public: + bool allow_includes_b_; + Includable_lexer (); ~Includable_lexer (); diff --git a/lily/include/main.hh b/lily/include/main.hh index 68b1b21363..17bd2480b4 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -18,8 +18,10 @@ void set_default_output (String s); String find_file (String); String get_version_str(); void call_constructors (); + extern Sources* source_global_l; extern bool no_paper_global_b; +extern bool safe_global_b; extern bool no_timestamps_global_b; extern bool find_quarts_global_b; extern int exit_status_i_; diff --git a/lily/main.cc b/lily/main.cc index 1f593f5aed..2477c9870f 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -45,6 +45,7 @@ String default_outname_base_global = "lelie"; int default_count_global; File_path global_path; +bool safe_global_b = false; bool experimental_features_global_b = false; bool dependency_global_b = false; @@ -67,6 +68,7 @@ Long_option_init theopts[] = { {0, "find-fourths", 'Q'}, {0, "ignore-version", 'V'}, {1, "output-format", 'f'}, + {0, "safe", 's'}, {0,0,0} }; @@ -109,6 +111,8 @@ usage () cout << _ ( " -Q, --find-fourths show all intervals greater than a fourth\n" ); + cout << _ ( + " -s, --safe inhibit file output naming and exporting TeX macros\n"); cout << _ ( " -t, --test switch on experimental features\n" ); @@ -284,6 +288,9 @@ main_prog (int argc, char **argv) case 'V': version_ignore_global_b = true; break; + case 's': + safe_global_b = true; + break; case 'd': dependency_global_b = true; break; diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index adace25f0a..83d97ab59b 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -12,6 +12,7 @@ #include "global-translator.hh" #include "dictionary-iter.hh" #include "identifier.hh" +#include "main.hh" int Music_output_def::get_next_default_count () const @@ -94,8 +95,8 @@ Music_output_def::print () const String Music_output_def::get_default_output () const { - if (!scope_p_->elem_b ("output")) - return ""; + if (safe_global_b || !scope_p_->elem_b ("output")) + return ""; Identifier * id = (*scope_p_) ["output"]; String *p = id->access_content_String (false); -- 2.39.5