X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Floader.cpp;h=997e7c9eec27f7f480c711291f6a47f997c7039e;hb=6a033cf0f5164915168f9cb778e801ed86450e1c;hp=4bc715aff01597c4164f19b206f5a31ae8db87fb;hpb=ed78b585cfc4ecb44972e346857e887b183fd7a7;p=libs%2Fdatafile.git diff --git a/source/loader.cpp b/source/loader.cpp index 4bc715a..997e7c9 100644 --- a/source/loader.cpp +++ b/source/loader.cpp @@ -47,28 +47,6 @@ bool signature_match(const string &st_sig, const string &act_sig) namespace Msp { namespace DataFile { -class unknown_keyword: public runtime_error -{ -public: - unknown_keyword(const std::string &k): - runtime_error(k) - { } - - virtual ~unknown_keyword() throw() { } -}; - - -class invalid_signature: public runtime_error -{ -public: - invalid_signature(const std::string &k, const std::string &s): - runtime_error(format("%s %s", k, s)) - { } - - virtual ~invalid_signature() throw() { } -}; - - Loader::Loader(): cur_st(0), direct(false), @@ -227,5 +205,12 @@ const string &Loader::get_source() const return cur_st->source; } +const string &Loader::get_keyword() const +{ + if(!cur_st) + throw logic_error("no current statement"); + return cur_st->keyword; +} + } // namespace DataFile } // namespace Msp