Includable_lexer::Includable_lexer ()
{
yy_current_buffer = 0;
+ allow_includes_b_ = true;
}
/** set the new input to s, remember old file.
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)
{
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);
/*
Array<int> char_count_stack_;
public:
+ bool allow_includes_b_;
+
Includable_lexer ();
~Includable_lexer ();
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_;
int default_count_global;
File_path global_path;
+bool safe_global_b = false;
bool experimental_features_global_b = false;
bool dependency_global_b = false;
{0, "find-fourths", 'Q'},
{0, "ignore-version", 'V'},
{1, "output-format", 'f'},
+ {0, "safe", 's'},
{0,0,0}
};
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"
);
case 'V':
version_ignore_global_b = true;
break;
+ case 's':
+ safe_global_b = true;
+ break;
case 'd':
dependency_global_b = true;
break;
#include "global-translator.hh"
#include "dictionary-iter.hh"
#include "identifier.hh"
+#include "main.hh"
int
Music_output_def::get_next_default_count () 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);