]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/warn.cc
release: 0.0.65
[lilypond.git] / lily / warn.cc
index 2b9f1db767d265d4a5a2cfcef701e71834aab139..c35e6e60158720cf1284f02447023a99f8c0ba69 100644 (file)
@@ -1,3 +1,11 @@
+/*
+  warn.cc -- implement warning and error messages. Needs cleanup.
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
 #include "proto.hh"
 #include "plist.hh"
 #include "debug.hh"
 #include "source-file.hh"
 #include "source.hh"
 #include "main.hh"
+#include "input.hh"
 
 ostream &warnout (cerr);
 ostream *mlog(&cerr);
-/*
-void
-warning(String s)
-{
-    WARN << s;
-}
-*/
 
-void
-error(String s)
-{
-    cerr <<  "error: " << s << "\n";
-       
-    exit(1);
-}
+
 
 void
 error_t(String const & s, Moment const & r)
@@ -40,39 +36,3 @@ error_t(String const & s, Time_description const &t_tdes)
     String e=s+ " (at t=" + String(t_tdes.bars_i_) + ": " + String(t_tdes.whole_in_measure_) + ")\n";
     error(e);
 }
-
-void
-message( String message_str, char const* context_ch_C )
-{
-    String str = "";           //"lilypond: ";// GNU format messages!
-    Source_file* sourcefile_l = source_l_g->sourcefile_l( context_ch_C );
-    if ( sourcefile_l ) {
-       str += sourcefile_l->file_line_no_str(context_ch_C) + String(": ");
-    }
-    str += message_str;
-    if ( sourcefile_l ) {
-       str += ":\n";
-       str += sourcefile_l->error_str( context_ch_C );
-    }
-    if ( busy_parsing() )
-       cerr << endl;
-    cerr << str << endl;
-}
-
-void
-warning( String message_str, char const* context_ch_C )
-{
-    message( "warning: " + message_str, context_ch_C );
-}
-
-void
-error( String message_str, char const* context_ch_C )
-{
-    message( message_str, context_ch_C );
-    // since when exits error again?
-    // i-d say: error: errorlevel |= 1; -> no output upon error
-    //          warning: recovery -> output (possibly wrong)
-/*    if ( lexer )
-        lexer->errorlevel_i_ |= 1;*/
-//    exit( 1 );
-}