Add Loader::finish() to handle finishing actions in an exception-safe way
*/
struct ItemKeywordBase
{
+ virtual ~ItemKeywordBase() { }
virtual void add_to_loader(Loader &) const { };
};
{
for(list<Statement>::const_iterator i=st.sub.begin(); i!=st.sub.end(); ++i)
load_statement(*i);
+ finish();
}
void Loader::load(Parser &p)
if(st.valid)
load_statement(st);
}
+ finish();
}
Loader::~Loader()
throw InvalidState("get_source called without current statement");
return cur_st->source;
}
+
+ virtual void finish() { }
private:
typedef std::map<std::string, LoaderAction *> ActionMap;