2004-06-22 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/my-lily-lexer.cc (My_lily_lexer): copy scopes so temporary
+ assignments don't reach the original file.
+
* lily/my-lily-parser.cc (My_lily_parser): only copy lexer if it
exists
chordmodifier_tab_ = src.chordmodifier_tab_;
pitchname_tab_stack_ = src.pitchname_tab_stack_;
sources_ = src.sources_;
- scopes_ = src.scopes_;
+
error_level_ = src.error_level_;
main_input_b_ = src.main_input_b_;
+
+ SCM scopes = SCM_EOL;
+ SCM* tail = &scopes;
+ for (SCM s = src.scopes_; ly_c_pair_p (s); s = ly_cdr (s))
+ {
+ SCM newmod = ly_make_anonymous_module (false);
+ ly_import_module (newmod, ly_car (s));
+ *tail = scm_cons (newmod, SCM_EOL);
+ tail = SCM_CDRLOC (*tail);
+ }
+
+ scopes_ = scopes;
}
My_lily_lexer::~My_lily_lexer ()
{
// yy_flex_debug = 1;
new_input (main_input_name_, sources_);
+
/* Do not allow \include in --safe-mode */
allow_includes_b_ = allow_includes_b_ && !safe_global_b;
scm_module_define (mod, sym, s);
}
-
else
{
programming_error ("Identifier is not a symbol.");
}
}
-
-
void
My_lily_lexer::LexerError (char const *s)
{
return '\n';
case 't':
return '\t';
-
case '\'':
case '\"':
case '\\':