Skip to content

Commit

Permalink
Merge pull request #20 from ToruNiina/format-error
Browse files Browse the repository at this point in the history
add an extra parameter `hints` to format_error
  • Loading branch information
ToruNiina authored Dec 27, 2018
2 parents 4584eeb + aa67069 commit 5dfdbe4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions toml/value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,17 +801,21 @@ inline bool operator>=(const toml::value& lhs, const toml::value& rhs)
}

inline std::string format_error(const std::string& err_msg,
const toml::value& v, const std::string& comment)
const toml::value& v, const std::string& comment,
std::vector<std::string> hints = {})
{
return detail::format_underline(err_msg, detail::get_region(v), comment);
return detail::format_underline(err_msg, detail::get_region(v), comment,
std::move(hints));
}

inline std::string format_error(const std::string& err_msg,
const toml::value& v1, const std::string& comment1,
const toml::value& v2, const std::string& comment2)
const toml::value& v2, const std::string& comment2,
std::vector<std::string> hints = {})
{
return detail::format_underline(err_msg, detail::get_region(v1), comment1,
detail::get_region(v2), comment2);
detail::get_region(v2), comment2,
std::move(hints));
}

}// toml
Expand Down

0 comments on commit 5dfdbe4

Please sign in to comment.