From: fred Date: Sun, 24 Mar 2002 19:27:53 +0000 (+0000) Subject: lilypond-0.0.23 X-Git-Tag: release/1.5.59~5612 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=60ff8ce5c06863b5f4dcbad968a262b5b4f768c8;p=lilypond.git lilypond-0.0.23 --- diff --git a/hdr/debug.hh b/hdr/debug.hh index 2f5c4ba47e..0e35476b39 100644 --- a/hdr/debug.hh +++ b/hdr/debug.hh @@ -1,12 +1,15 @@ #ifndef DEBUG_HH #define DEBUG_HH + #include #include #include "dstream.hh" #include "real.hh" +#include "proto.hh" void error(String s); // errors - +void error_t(const String& s, Time_description const & t_tdes); +void error_t(String const &s, const Moment &when); // warnings void warning(String s); #define WARN warnout << "warning: "<<__FUNCTION__ << "(): " diff --git a/hdr/moment.hh b/hdr/moment.hh index 1f34eae5ab..0037d94078 100644 --- a/hdr/moment.hh +++ b/hdr/moment.hh @@ -8,7 +8,7 @@ #include "rational.hh" class String; typedef Rational Moment; -void error_t(String const &s, Moment when); + #endif // diff --git a/src/warn.cc b/src/warn.cc index 0c3cac1186..82a004875a 100644 --- a/src/warn.cc +++ b/src/warn.cc @@ -1,6 +1,7 @@ #include "debug.hh" #include "lexer.hh" #include "moment.hh" +#include "timedescription.hh" ostream &warnout (cerr); ostream *mlog(&cerr); @@ -24,10 +25,17 @@ error(String s) } void -error_t(const String& s, Moment r) +error_t(const String& s, const Moment& r) { - String e=s+ "(t = " + String(r) + ")"; + String t_mom = String(trunc(r)) + (r - Moment(trunc(r))); + String e=s+ "(t = " + t_mom + ")"; error(e); - exit(1); } + +void +error_t(const String& s, Time_description const &t_tdes) +{ + String e=s+ "(at " + t_tdes.bars + ": " + t_tdes.whole_in_measure + ")\n"; + error(e); +}