2 warn.cc -- implement warning and error messages. Needs cleanup.
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
12 #include "my-lily-lexer.hh"
14 #include "time-description.hh"
15 #include "source-file.hh"
20 ostream &warnout (cerr);
27 cerr << "error: " << s << "\n";
33 error_t(String const & s, Moment const & r)
35 String t_mom = String(trunc(r)) + String(r - Moment(trunc(r)));
36 String e=s+ " (t = " + t_mom + ")";
41 error_t(String const & s, Time_description const &t_tdes)
43 String e=s+ " (at t=" + String(t_tdes.bars_i_) + ": " + String(t_tdes.whole_in_measure_) + ")\n";
48 message( String message_str, char const* context_ch_C )
51 Source_file* sourcefile_l = source_l_g->sourcefile_l( context_ch_C );
53 str += sourcefile_l->file_line_no_str(context_ch_C) + String(": ");
58 str += sourcefile_l->error_str( context_ch_C );
66 warning( String message_str, char const* context_ch_C )
68 message( "warning: " + message_str, context_ch_C );
72 error( String message_str, char const* context_ch_C )
74 message( message_str, context_ch_C );
75 // since when exits error again?
76 // i-d say: error: errorlevel |= 1; -> no output upon error
77 // warning: recovery -> output (possibly wrong)
79 lexer->errorlevel_i_ |= 1;*/