X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Floader.cpp;h=3484799a3e4891b12b622139b646e27a582690a1;hb=ef12cc79fddd527e895169f62d7424b18d5937ca;hp=51e22edf7a8e47c4ea1b02a3b1077d14e34f1f6e;hpb=0881c95bef812d94d8086225c2736b4f15b4c8dc;p=libs%2Fdatafile.git diff --git a/source/loader.cpp b/source/loader.cpp index 51e22ed..3484799 100644 --- a/source/loader.cpp +++ b/source/loader.cpp @@ -54,12 +54,6 @@ Loader::Loader(): check_sub_loads(false) { } -Loader::~Loader() -{ - for(ActionMap::iterator i=local_actions.begin(); i!=local_actions.end(); ++i) - delete i->second; -} - void Loader::load(Parser &p) { if(!actions) @@ -137,9 +131,12 @@ void Loader::load_statement(const Statement &st) throw logic_error("substatements ignored"); } } - catch(const data_error &) + catch(const data_error &e) { - throw; + if(e.get_source()!=st.source) + throw data_error(st.source, st.line, e); + else + throw; } catch(const exception &e) { @@ -229,7 +226,7 @@ LoaderAction *Loader::find_action(const StatementKey &key) const } } - if(!act) + if(!match) throw invalid_signature(key.keyword, key.signature); return act; @@ -249,5 +246,12 @@ const string &Loader::get_keyword() const return cur_st->keyword; } + +Loader::ActionMap::~ActionMap() +{ + for(iterator i=begin(); i!=end(); ++i) + delete i->second; +} + } // namespace DataFile } // namespace Msp