tokenizer::error
This commit is contained in:
parent
064d59de13
commit
7830f430c0
@ -54,6 +54,18 @@ namespace nana
|
|||||||
class tokenizer
|
class tokenizer
|
||||||
{
|
{
|
||||||
public:
|
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<unsigned>(tok.sp_ - tok.divstr_)) },
|
||||||
|
pos{static_cast<std::string::size_type>(tok.sp_ - tok.divstr_)}
|
||||||
|
{}
|
||||||
|
std::string::size_type pos;
|
||||||
|
};
|
||||||
|
|
||||||
enum class token
|
enum class token
|
||||||
{
|
{
|
||||||
div_start, div_end, splitter,
|
div_start, div_end, splitter,
|
||||||
@ -462,8 +474,8 @@ namespace nana
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
const char* divstr_;
|
const char* divstr_{};
|
||||||
const char* sp_;
|
const char* sp_{};
|
||||||
std::string idstr_;
|
std::string idstr_;
|
||||||
number_t number_;
|
number_t number_;
|
||||||
std::vector<number_t> array_;
|
std::vector<number_t> array_;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user