]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.23
authorfred <fred>
Sun, 24 Mar 2002 19:27:53 +0000 (19:27 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:27:53 +0000 (19:27 +0000)
hdr/debug.hh
hdr/moment.hh
src/warn.cc

index 2f5c4ba47e48a65680f88101323c76d2b4d2bb4e..0e35476b39d73b586fe448182990398f38cc8b0b 100644 (file)
@@ -1,12 +1,15 @@
 #ifndef DEBUG_HH
 #define DEBUG_HH
+
 #include <assert.h>
 #include <iostream.h>
 #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__ << "(): "
index 1f34eae5abf04bdd47166a2fc7d49075cc8873f2..0037d940784dae5bb5d6d7c6a49d87fad2e26c9c 100644 (file)
@@ -8,7 +8,7 @@
 #include "rational.hh"
 class String;
 typedef Rational Moment;
-void error_t(String const &s, Moment when);
+
 
 #endif // 
 
index 0c3cac1186d1d1b3022aa209497fdaa18e7e0b15..82a004875aaa91b17cfed0f40c566c317aca6da1 100644 (file)
@@ -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);
+}