]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-parser.cc
clean up Sources
[lilypond.git] / lily / lily-parser.cc
index 8c5d43b2026f0f3672cf26c8b1c331e0d96fade2..ac468b771e74c53606ebfc98871fcdef32b8a773 100644 (file)
@@ -127,7 +127,7 @@ Lily_parser::parse_file (string init, string name, string out_name)
     }
 
   error_level_ = error_level_ | lexer_->error_level_;
-  lexer_ = 0;
+  clear ();
 }
 
 void
@@ -156,6 +156,19 @@ Lily_parser::parse_string (string ly_code)
   error_level_ = error_level_ | lexer_->error_level_;
 }
 
+void
+Lily_parser::clear ()
+{
+  if (lexer_)
+    {
+      while (lexer_->has_scope ())
+       lexer_->remove_scope ();
+
+      
+    }
+  lexer_ = 0;  
+}
+
 char const *
 Lily_parser::here_str0 () const
 {