]> git.donarmstrong.com Git - lilypond.git/commitdiff
Don't let cloned parsers and lexers inherit error state.
authorDavid Kastrup <dak@gnu.org>
Mon, 21 Nov 2011 09:12:52 +0000 (10:12 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 21 Nov 2011 09:15:10 +0000 (10:15 +0100)
lily/lily-lexer.cc
lily/lily-parser.cc
scm/parser-ly-from-scheme.scm

index be76d90bd75f7cd2b6c886062708c4e6d6d7f0d5..64878444a18f5164e7bc898d59e7b5c7cea46bfd 100644 (file)
@@ -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;
index d9af8cbb7e43126bc8a8a51c288907532935a1bc..2d19da83109251d8872a629e1396e47fe8f5f524 100644 (file)
@@ -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;
 
index 1a51a3714006a04e26fbc67b0dc084388ee6736a..3f19641916c51a87030a13a10bfa6df1afce49a4 100644 (file)
@@ -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)))