mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-23 04:40: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,
|
||||
"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 char c = *(loc.iter());
|
||||
@ -89,7 +89,7 @@ struct in_range
|
||||
static_assert(std::is_same<char, typename Cont::value_type>::value,
|
||||
"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 char c = *(loc.iter());
|
||||
@ -123,7 +123,7 @@ struct exclude
|
||||
static_assert(std::is_same<char, typename Cont::value_type>::value,
|
||||
"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 rslt = Combinator::invoke(loc);
|
||||
|
Loading…
Reference in New Issue
Block a user