X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flily-parser.cc;h=ac468b771e74c53606ebfc98871fcdef32b8a773;hb=7785ac382ed511ed535adf77adc3c07649fbc9b5;hp=8c5d43b2026f0f3672cf26c8b1c331e0d96fade2;hpb=fa60b01a20f21d6aff9c0923a0b76de9fe106c30;p=lilypond.git diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 8c5d43b202..ac468b771e 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -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 {