]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.1.13
authorfred <fred>
Tue, 26 Mar 2002 21:45:03 +0000 (21:45 +0000)
committerfred <fred>
Tue, 26 Mar 2002 21:45:03 +0000 (21:45 +0000)
lily/includable-lexer.cc
lily/include/includable-lexer.hh
lily/include/main.hh
lily/main.cc
lily/music-output-def.cc

index 1adf85425d4d6f5eef95fc944d10e19ec41a1083..45607f77ee4bd953432588d23bf82e70552f2d2a 100644 (file)
@@ -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<<flush;
+  *mlog << "[" << s<< flush;
   include_stack_.push (sl);
 
   /*
index 6837efc1f5fa1b44ae6d57095687062b2be5c500..51aa0937adf9d45c9cf3d0c07cd617435349c117 100644 (file)
@@ -33,6 +33,8 @@ protected:
   Array<int> char_count_stack_;
 
 public:
+  bool allow_includes_b_;
+  
   Includable_lexer ();
   ~Includable_lexer ();
 
index 68b1b21363b54aac5e01190a2165ab1dfc8eb4bf..17bd2480b436777f76f8573e7ec2a86c107cfe75 100644 (file)
@@ -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_;
index 1f593f5aed3236d63e9ad9bca51486ae83d46b1c..2477c9870f599aaec980d7a47cd64be3adf782ed 100644 (file)
@@ -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; 
index adace25f0acbbf75568ff71ca910a6fb88190b82..83d97ab59b3ccf392b0f414b1be27da0c2fe524d 100644 (file)
@@ -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);