2004-08-02 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/lily-parser.cc (parse_string): don't overwrite keytable_.
+
* lily/slur-quanting.cc (enumerate_attachments): apply center on
stem-X in more cases.
int identifier_type (SCM);
char escaped_char (char) const;
+ Keyword_table *keytable_;
public:
String main_input_name_;
void *lexval;
SCM chordmodifier_tab_;
SCM pitchname_tab_stack_;
- Keyword_table *keytable_;
int error_level_;
Input last_input_;
Lily_lexer::Lily_lexer (Lily_lexer const &src)
: Includable_lexer ()
{
- keytable_ = (src.keytable_) ? new Keyword_table (*src.keytable_) : 0;
+ keytable_ = (src.keytable_) ? new Keyword_table (*src.keytable_) : 0;
encoding_ = src.encoding_;
chordmodifier_tab_ = src.chordmodifier_tab_;
pitchname_tab_stack_ = src.pitchname_tab_stack_;
smobify_self ();
SCM scopes = SCM_EOL;
- SCM* tail = &scopes;
+ SCM *tail = &scopes;
for (SCM s = src.scopes_; ly_c_pair_p (s); s = ly_cdr (s))
{
SCM newmod = ly_make_anonymous_module (false);
encoding_ = SCM_EOL;
}
-
#include "ly-smobs.icc"
IMPLEMENT_SMOBS (Lily_lexer);
void
Lily_parser::parse_string (String ly_code)
{
- Lily_lexer *parent = lexer_;
+ SCM parent_prot = lexer_ ? lexer_->self_scm () : SCM_EOL;
+ Lily_lexer * parent = lexer_;
lexer_ = (parent == 0 ? new Lily_lexer (sources_)
: new Lily_lexer (*parent));
scm_gc_unprotect_object (lexer_->self_scm ());
error_level_ = error_level_ | lexer_->error_level_;
- if (parent != 0)
+#if 0
+ if (Lily_lexer::unsmob (parent_prot))
{
- parent->keytable_ = lexer_->keytable_;
+ /*
+ what the fuck is this good for?
+ */
parent->encoding_ = lexer_->encoding_;
parent->chordmodifier_tab_ = lexer_->chordmodifier_tab_;
parent->pitchname_tab_stack_ = lexer_->pitchname_tab_stack_;
parent->error_level_ = lexer_->error_level_;
parent->main_input_b_ = lexer_->main_input_b_;
}
-
+
+ scm_remember_upto_here_1 (parent_prot);
+#endif
+
scm_set_current_module (oldmod);
lexer_ = 0;
}