From: David Kastrup Date: Mon, 21 Nov 2011 09:12:52 +0000 (+0100) Subject: Don't let cloned parsers and lexers inherit error state. X-Git-Tag: release/2.15.20-1~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=48dfdac8c2a8044d3154041bf67a531f302ac4d1;p=lilypond.git Don't let cloned parsers and lexers inherit error state. --- diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index be76d90bd7..64878444a1 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -118,7 +118,7 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src, Lily_parser *parser) start_module_ = SCM_EOL; chord_repetition_ = src.chord_repetition_; - error_level_ = src.error_level_; + error_level_ = 0; is_main_input_ = src.is_main_input_; scopes_ = SCM_EOL; diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index d9af8cbb7e..2d19da8310 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -57,7 +57,7 @@ Lily_parser::Lily_parser (Lily_parser const &src, SCM env) lexer_ = 0; sources_ = src.sources_; default_duration_ = src.default_duration_; - error_level_ = src.error_level_; + error_level_ = 0; output_basename_ = src.output_basename_; local_environment_ = env; diff --git a/scm/parser-ly-from-scheme.scm b/scm/parser-ly-from-scheme.scm index 1a51a37140..3f19641916 100644 --- a/scm/parser-ly-from-scheme.scm +++ b/scm/parser-ly-from-scheme.scm @@ -33,9 +33,7 @@ from @var{port} and return the corresponding Scheme music expression. (display c out))))))) `(let* ((clone (ly:parser-clone parser (procedure-environment (lambda () '())))) - (result (begin - (ly:parser-clear-error clone) - (ly:parse-string-expression clone ,lily-string)))) + (result (ly:parse-string-expression clone ,lily-string))) (if (ly:parser-has-error? clone) (ly:parser-error parser (_ "error in #{ ... #}"))) result)))