From df314da7510ee565e4e6a3ca5a1d04701cb528c6 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Thu, 6 Dec 2018 17:03:57 +0900 Subject: [PATCH] change error message considering context combinators are used with other parser-combinators. in such cases, empty input means `not enough character`. --- toml/combinator.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toml/combinator.hpp b/toml/combinator.hpp index eb282dd..30cd028 100644 --- a/toml/combinator.hpp +++ b/toml/combinator.hpp @@ -54,7 +54,7 @@ struct character static_assert(std::is_same::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::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::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);