delete i->second;
}
+void Loader::add(const string &k, LoaderAction *a)
+{
+ ActionMap::iterator i=actions.find(k);
+ if(i!=actions.end())
+ {
+ delete i->second;
+ i->second=a;
+ }
+ else
+ actions[k]=a;
+}
+
void Loader::load_statement(const Statement &st)
{
cur_st=&st;
ActionMap::iterator j=actions.find(st.keyword);
if(j==actions.end())
- throw KeyError(st.get_location()+": Unknown keyword '"+st.keyword+"'");
+ throw KeyError(st.get_location()+": Unknown keyword", st.keyword);
if(j->second)
j->second->execute(*this, st);
cur_st=0;