source file of the LilyPond music typesetter
- (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "input.hh"
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)
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
int
Input::column_number () const
{
- int line, chr, col = 0;
- source_file_->get_counts (start_, &line, &chr, &col);
+ int line, chr, col, offset = 0;
+ source_file_->get_counts (start_, &line, &chr, &col, &offset);
return col;
}
int
Input::end_column_number () const
{
- int line, chr, col = 0;
- source_file_->get_counts (end_, &line, &chr, &col);
+ int line, chr, col, offset = 0;
+ source_file_->get_counts (end_, &line, &chr, &col, &offset);
return col;
}
void
-Input::get_counts (int *line, int *chr, int *col) const
+Input::get_counts (int *line, int *chr, int *col, int *offset) const
{
- source_file_->get_counts (start_, line, chr, col);
+ source_file_->get_counts (start_, line, chr, col, offset);
}
void