Go to the documentation of this file.
4 #ifndef LEXY_ERROR_HPP_INCLUDED
5 #define LEXY_ERROR_HPP_INCLUDED
13 template <
typename Reader,
typename Tag>
17 template <
typename Reader>
21 constexpr
explicit error(
typename Reader::iterator pos,
const char* msg) noexcept
22 : _pos(pos), _end(pos), _msg(msg)
24 constexpr
explicit error(
typename Reader::iterator
begin,
typename Reader::iterator
end,
25 const char* msg) noexcept
30 typename Reader::iterator,
typename OtherReader::iterator>>>
41 constexpr
const char*
message() const noexcept
45 template <
typename Tag>
46 constexpr
bool is(Tag = {})
const noexcept
51 constexpr
auto begin() const noexcept
55 constexpr
auto end() const noexcept
61 typename Reader::iterator
_pos;
62 typename Reader::iterator
_end;
67 template <
typename Reader,
typename Tag>
71 constexpr
explicit error(
typename Reader::iterator pos) noexcept
74 constexpr
explicit error(
typename Reader::iterator
begin,
75 typename Reader::iterator
end) noexcept
80 typename Reader::iterator,
typename OtherReader::iterator>>>
90 template <
typename Reader>
94 constexpr
explicit error(
typename Reader::iterator pos,
96 std::size_t length) noexcept
97 : _pos(pos), _str(str), _idx(index), _length(length)
101 typename Reader::iterator,
typename OtherReader::iterator>>>
117 constexpr std::size_t
index() const noexcept
122 constexpr std::size_t
length() const noexcept
133 typename Reader::iterator
_pos;
142 template <
typename Reader>
146 constexpr
explicit error(
typename Reader::iterator
begin,
typename Reader::iterator
end,
148 : _begin(
begin), _end(
end), _str(str), _length(length)
152 typename Reader::iterator,
typename OtherReader::iterator>>>
163 constexpr
auto begin() const noexcept
167 constexpr
auto end() const noexcept
177 constexpr std::size_t
length() const noexcept
184 typename Reader::iterator
_end;
192 template <
typename Reader>
196 constexpr
explicit error(
typename Reader::iterator pos,
const char* name) noexcept
197 : _pos(pos), _name(name)
201 typename Reader::iterator,
typename OtherReader::iterator>>>
212 constexpr
const char*
name() const noexcept
218 typename Reader::iterator
_pos;
222 template <
typename Input,
typename Tag>
228 template <
typename Input>
232 template <
typename Input>
242 constexpr
const auto&
input() const noexcept
244 if constexpr (_detail::is_detected<_detect_parent_input, Input>)
245 return _input->parent_input();
269 #endif // LEXY_ERROR_HPP_INCLUDED
constexpr auto position() const noexcept
The starting position of the production.
constexpr auto character() const noexcept
string_view::value_type char_type
constexpr auto position() const noexcept
constexpr error(typename Reader::iterator begin, typename Reader::iterator end) noexcept
constexpr auto string() const noexcept -> const typename Reader::encoding::char_type *
const Reader::encoding::char_type * _str
constexpr error(typename Reader::iterator begin, typename Reader::iterator end, const char *msg) noexcept
constexpr auto position() const noexcept
constexpr error(typename Reader::iterator pos) noexcept
input_reader< Input >::iterator _pos
constexpr error(typename Reader::iterator pos, const char *msg) noexcept
constexpr error_context(lexy::production_info production, const Input &input, typename input_reader< Input >::iterator pos) noexcept
Contains information about the context of an error, production is type-erased.
constexpr bool is(Tag={}) const noexcept
constexpr auto end() const noexcept
const char * production() const noexcept
The name of the production where the error occurred.
constexpr auto end(const C &c) -> decltype(c.end())
constexpr auto end() const noexcept
constexpr error(typename Reader::iterator pos, const char *name) noexcept
Type erased generic failure.
decltype(LEXY_DECLVAL(Input).parent_input()) _detect_parent_input
const Reader::encoding::char_type * _str
constexpr std::size_t length() const noexcept
constexpr auto begin() const noexcept
constexpr std::size_t length() const noexcept
constexpr auto begin(const C &c) -> decltype(c.begin())
Expected the literal character sequence.
constexpr auto begin() const noexcept
constexpr auto string() const noexcept -> const typename Reader::encoding::char_type *
constexpr auto position() const noexcept
constexpr const char * message() const noexcept
constexpr error(typename Reader::iterator begin, typename Reader::iterator end, const typename Reader::encoding::char_type *str, std::size_t length)
constexpr auto position() const noexcept
constexpr const auto & input() const noexcept
The input.
constexpr std::size_t index() const noexcept
#define LEXY_DECLVAL(...)
constexpr const char * name() const noexcept
constexpr error(typename Reader::iterator pos, const typename Reader::encoding::char_type *str, std::size_t index, std::size_t length) noexcept
Expected a character of the specified character class.
decltype(LEXY_DECLVAL(Input).reader()) input_reader
basic_string_view< char > string_view
typename std::enable_if< B, T >::type enable_if_t