mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-26 22:30:06 +00:00
change error message considering context
combinators are used with other parser-combinators. in such cases, empty input means `not enough character`.
This commit is contained in:
parent
3d1783e12a
commit
df314da751
@ -54,7 +54,7 @@ struct character
|
|||||||
static_assert(std::is_same<char, typename Cont::value_type>::value,
|
static_assert(std::is_same<char, typename Cont::value_type>::value,
|
||||||
"internal error: container::value_type should be `char`.");
|
"internal error: container::value_type should be `char`.");
|
||||||
|
|
||||||
if(loc.iter() == loc.end()) {return err("empty input");}
|
if(loc.iter() == loc.end()) {return err("not sufficient characters");}
|
||||||
const auto first = loc.iter();
|
const auto first = loc.iter();
|
||||||
|
|
||||||
const char c = *(loc.iter());
|
const char c = *(loc.iter());
|
||||||
@ -89,7 +89,7 @@ struct in_range
|
|||||||
static_assert(std::is_same<char, typename Cont::value_type>::value,
|
static_assert(std::is_same<char, typename Cont::value_type>::value,
|
||||||
"internal error: container::value_type should be `char`.");
|
"internal error: container::value_type should be `char`.");
|
||||||
|
|
||||||
if(loc.iter() == loc.end()) {return err("empty input");}
|
if(loc.iter() == loc.end()) {return err("not sufficient characters");}
|
||||||
const auto first = loc.iter();
|
const auto first = loc.iter();
|
||||||
|
|
||||||
const char c = *(loc.iter());
|
const char c = *(loc.iter());
|
||||||
@ -123,7 +123,7 @@ struct exclude
|
|||||||
static_assert(std::is_same<char, typename Cont::value_type>::value,
|
static_assert(std::is_same<char, typename Cont::value_type>::value,
|
||||||
"internal error: container::value_type should be `char`.");
|
"internal error: container::value_type should be `char`.");
|
||||||
|
|
||||||
if(loc.iter() == loc.end()) {return err("empty input");}
|
if(loc.iter() == loc.end()) {return err("not sufficient characters");}
|
||||||
auto first = loc.iter();
|
auto first = loc.iter();
|
||||||
|
|
||||||
auto rslt = Combinator::invoke(loc);
|
auto rslt = Combinator::invoke(loc);
|
||||||
|
Loading…
Reference in New Issue
Block a user