]> git.donarmstrong.com Git - lilypond.git/commitdiff
(parse_string): don't overwrite keytable_.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 1 Aug 2004 23:55:21 +0000 (23:55 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 1 Aug 2004 23:55:21 +0000 (23:55 +0000)
ChangeLog
lily/include/lily-lexer.hh
lily/lily-lexer.cc
lily/lily-parser.cc

index a2217214dbaf38b95037d08dd74ece0bedbc3d27..d65f974c2a0dd866323713211d858b5178f6a79a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 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. 
 
index b697068bcd99f52aaa99ee12c55bc3907e784902..71a0d58fdf43ab7a6209821302397354f07bfc4d 100644 (file)
@@ -42,6 +42,7 @@ private:
   int identifier_type (SCM);
   char escaped_char (char) const;
 
+  Keyword_table *keytable_;
 public:
   String main_input_name_;
   void *lexval;
@@ -53,7 +54,6 @@ public:
   SCM chordmodifier_tab_;
   SCM pitchname_tab_stack_;
 
-  Keyword_table *keytable_;
   int error_level_;
   Input last_input_;
 
index fa0ae8d544238ca2407278de4a33ccd9ff981197..49e680a1225b4558e5648a5681912d01418b2f10 100644 (file)
@@ -104,7 +104,7 @@ Lily_lexer::Lily_lexer (Sources *sources)
 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_;
@@ -118,7 +118,7 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src)
   smobify_self ();
   
   SCM scopes = SCM_EOL;
-  SCMtail = &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);
@@ -281,7 +281,6 @@ Lily_lexer::set_encoding (String s)
     encoding_ = SCM_EOL;
 }
 
-
 #include "ly-smobs.icc"
 
 IMPLEMENT_SMOBS (Lily_lexer);
index 5827f75a9555e2b9e80d86f9928e98bb0448c930..3b106602b13ed36c45441077c0600de839c17dfb 100644 (file)
@@ -118,7 +118,8 @@ Lily_parser::parse_file (String init, String name, String out_name)
 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 ());
@@ -146,9 +147,12 @@ Lily_parser::parse_string (String ly_code)
 
   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_;
@@ -157,7 +161,10 @@ Lily_parser::parse_string (String ly_code)
       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;
 }