#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__ << "(): "
#include "debug.hh"
#include "lexer.hh"
#include "moment.hh"
+#include "timedescription.hh"
ostream &warnout (cerr);
ostream *mlog(&cerr);
}
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);
+}