refactor: use literal instead of empty string

so far, the error value of the lexer is just ignored because they are
not readable (results from all the nested combinator are concatenated,
so they are too redundant). those ones are replaced by a simple literal.
This commit is contained in:
ToruNiina 2019-05-30 19:33:25 +09:00
parent b13e727b90
commit 8bba3c8a14

View File

@ -611,7 +611,7 @@ parse_local_date(location<Container>& loc)
{
throw internal_error(format_underline("[error]: "
"toml::parse_local_date: invalid day format",
{{std::addressof(inner_loc), d.unwrap_err()}}));
{{std::addressof(inner_loc), "here"}}));
}
return ok(std::make_pair(local_date(
static_cast<std::int16_t>(from_string<int>(y.unwrap().str(), 0)),
@ -664,7 +664,7 @@ parse_local_time(location<Container>& loc)
{
throw internal_error(format_underline("[error]: "
"toml::parse_local_time: invalid second format",
{{std::addressof(inner_loc), s.unwrap_err()}}));
{{std::addressof(inner_loc), "here"}}));
}
local_time time(
static_cast<std::int8_t>(from_string<int>(h.unwrap().str(), 0)),
@ -700,7 +700,7 @@ parse_local_time(location<Container>& loc)
{
throw internal_error(format_underline("[error]: "
"toml::parse_local_time: invalid subsecond format",
{{std::addressof(inner_loc), secfrac.unwrap_err()}}));
{{std::addressof(inner_loc), "here"}}));
}
}
return ok(std::make_pair(time, token.unwrap()));