X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fwarn.cc;h=b371ddabe8351e72caf07c8d96417a865d7c77b0;hb=42c9f0b04886b8a8318cb23d7fe72a90abb41afe;hp=4240aa04b5459a6da8f2b0f6d64c3bd28a8320f8;hpb=3f374e66968308461daa390a7aeed0b013bfe33d;p=lilypond.git diff --git a/lily/warn.cc b/lily/warn.cc index 4240aa04b5..b371ddabe8 100644 --- a/lily/warn.cc +++ b/lily/warn.cc @@ -1,94 +1,25 @@ /* warn.cc -- implement warning and error messages. Needs cleanup. - source file of the LilyPond music typesetter + source file of the GNU LilyPond music typesetter - (c) 1997 Han-Wen Nienhuys + (c) 1997--2000 Han-Wen Nienhuys */ -#include "proto.hh" -#include "plist.hh" #include "debug.hh" #include "my-lily-lexer.hh" #include "moment.hh" -#include "time-description.hh" +#include "timing-translator.hh" #include "source-file.hh" #include "source.hh" #include "main.hh" #include "input.hh" ostream &warnout (cerr); -ostream *mlog(&cerr); - - -void -error(String s) -{ - cerr << "error: " << s << "\n"; - - exit(1); -} void -error_t(String const & s, Moment const & r) +progress_indication (String s) { - String t_mom = String(trunc(r)) + String(r - Moment(trunc(r))); - String e=s+ " (t = " + t_mom + ")"; - error(e); + cerr << s << flush; } -void -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 = ""; - 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 ); -} - - -void -warning(String m) -{ - warning(m, (char*)0); -} - -void -message(String m) -{ - error(m, (char*)0); -}