2 input.cc -- implement Input
4 source file of the LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 #include "source-file.hh"
14 Input::Input (Source_file*s, char const *cl)
33 Input::set_spot (Input const &i)
39 Produce almost GNU-compliant error message. Lily used to be rather
40 GNU-compliant in this too, but correcting mudela is such a breeze if
41 you('re edidor) know(s) the error column too (there's no GNU standard
42 on columns, is there?).
46 [file:line:column:][warning:]message
50 Input::message (String message_str) const
55 marked "Work in prgress" in GNU iostream
59 why not just return always -1 (unknown),
60 iso breaking the interface?
62 int col = cerr.rdbuf ()->column ();
66 // well, we don't want to loose first warning...
72 str += location_str () + String (": ");
78 str += source_file_l_->error_str (defined_ch_C_);
84 Input::warning (String message_str) const
86 message (_ ("warning: ") + message_str);
89 Input::error (String s) const
91 message (_ ("error: ")+ s);
95 Input::non_fatal_error (String s) const
97 message (_ ("Non fatal error: ") + s);
100 Input::location_str () const
103 return source_file_l_->file_line_column_str (defined_ch_C_);
105 return "(" + _ ("position unknown") + ")";