namespace Msp {
namespace DataFile {
+class bad_definition: public runtime_error
+{
+public:
+ bad_definition(const std::string &w):
+ runtime_error(w)
+ { }
+
+ virtual ~bad_definition() throw() { }
+};
+
+
BinaryParser::BinaryParser(Input &i, const string &s):
ParserMode(i, s),
first(true)
if(st.keyword=="__kwd")
{
if(st.args.size()!=3)
- throw_at(TypeError("Keyword definition must have three arguments"), src);
+ throw bad_definition("__kwd");
const unsigned id = st.args[0].get<unsigned>();
const string &kw = st.args[1].get<const string &>();
else if(st.keyword=="__str")
{
if(st.args.size()!=2)
- throw_at(TypeError("String definition must have two arguments"), src);
+ throw bad_definition("__str");
const unsigned id = st.args[0].get<unsigned>();
strings[id] = st.args[1].get<const string &>();