]> 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 3d998b384e6d806761ce122ede378e69cf200c8e..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,8 +12,9 @@
 using namespace std;
 
 #include "international.hh"
+#include "program-option.hh"
 #include "source-file.hh"
-#include "source.hh"
+#include "sources.hh"
 #include "warn.hh"
 
 Input::Input (Input const &i)
@@ -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