]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/input.cc
Merge branch 'master' of carldsorensen@git.sv.gnu.org:/srv/git/lilypond
[lilypond.git] / lily / input.cc
index 09028d0858ea4a00fbaf39c24055c370c1e74dad..f2ddedd4e8b619e61e45c933f8a8c25aa8170445 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the LilyPond music typesetter
 
-  (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "input.hh"
@@ -12,6 +12,7 @@
 using namespace std;
 
 #include "international.hh"
+#include "program-option.hh"
 #include "source-file.hh"
 #include "sources.hh"
 #include "warn.hh"
@@ -79,15 +80,22 @@ Input::message (string s) const
 void
 Input::programming_error (string s) const
 {
-  message (_f ("programming error: %s", s.c_str ()));
-  message (_ ("continuing, cross fingers") + "\n");
+  if (get_program_option ("warning-as-error"))
+    ::error (s);
+  else {
+    message (_f ("programming error: %s", s.c_str ()));
+    message (_ ("continuing, cross fingers") + "\n");
+  }
 }
 
 
 void
 Input::warning (string s) const
 {
-  message (_f ("warning: %s", s));
+  if (get_program_option ("warning-as-error"))
+    ::error (s);
+  else
+    message (_f ("warning: %s", s));
 }
 
 void