From 7830f430c0fc8af10f1f045c7000fcdc019e494e Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 14 Apr 2019 19:44:51 +0200 Subject: [PATCH] tokenizer::error --- source/gui/place.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/source/gui/place.cpp b/source/gui/place.cpp index 4fb3ebab..a9177e28 100644 --- a/source/gui/place.cpp +++ b/source/gui/place.cpp @@ -54,6 +54,18 @@ namespace nana class tokenizer { public: + struct error : std::invalid_argument + { + error(std::string what, + const tokenizer& tok) + + : std::invalid_argument{ what + " from tokenizer at position " + + std::to_string(static_cast(tok.sp_ - tok.divstr_)) }, + pos{static_cast(tok.sp_ - tok.divstr_)} + {} + std::string::size_type pos; + }; + enum class token { div_start, div_end, splitter, @@ -462,8 +474,8 @@ namespace nana return 0; } private: - const char* divstr_; - const char* sp_; + const char* divstr_{}; + const char* sp_{}; std::string idstr_; number_t number_; std::vector array_;