6 #ifndef SPIRIT_PO_EXCEPTIONS_HPP_INCLUDED
7 #define SPIRIT_PO_EXCEPTIONS_HPP_INCLUDED
10 #include <boost/spirit/include/support_line_pos_iterator.hpp>
17 template <
typename Iterator>
20 std::size_t line_no = boost::spirit::get_line(it);
21 if (line_no !=
static_cast<std::size_t
>(-1)) {
22 result =
"Line " + std::to_string(line_no) +
":\n";
25 unsigned int count = 80;
26 while (it != end && count) {
37 std::string::const_iterator it) {
38 std::string result{str};
41 for (
auto temp = str.begin(); temp != it; ++temp) {
51 #ifdef SPIRIT_PO_NO_EXCEPTIONS
53 #define SPIRIT_PO_CATALOG_FAIL(Message) \
55 error_message_ = (Message); \
72 #define SPIRIT_PO_CATALOG_FAIL(Message) \
74 throw spirit_po::catalog_exception(( Message )); \
std::string string_iterator_context(const std::string &str, std::string::const_iterator it)
std::string iterator_context(Iterator &it, Iterator &end)
catalog_exception(const char *what)
catalog_exception(const std::string &what)