Go to the documentation of this file.
4 #ifndef LEXY_DSL_CODE_POINT_HPP_INCLUDED
5 #define LEXY_DSL_CODE_POINT_HPP_INCLUDED
13 template <
typename Predicate>
18 if constexpr (std::is_void_v<Predicate>)
21 return lexy::_detail::type_name<Predicate>();
26 if constexpr (std::is_void_v<Predicate>)
35 for (
auto c = 0; c <= 0x7F; ++c)
44 if constexpr (std::is_void_v<Predicate>)
52 constexpr
auto if_()
const
54 static_assert(std::is_void_v<Predicate>);
58 template <
char32_t Low,
char32_t High>
65 return "code-point.range";
70 return Low <= cp.
value() && cp.
value() <= High;
74 return if_<predicate>();
77 template <char32_t... CPs>
78 constexpr
auto set()
const
84 return "code-point.set";
89 return ((cp.
value() == CPs) || ...);
93 return if_<predicate>();
102 return "code-point.ASCII";
111 return if_<predicate>();
113 constexpr
auto bmp()
const
119 return "code-point.BMP";
128 return if_<predicate>();
136 return "code-point.non-character";
145 return if_<predicate>();
148 template <lexy::code_po
int::general_category_t Category>
162 if constexpr (Category == lexy::code_point::Cc)
164 else if constexpr (Category == lexy::code_point::Cs)
166 else if constexpr (Category == lexy::code_point::Co)
173 return if_<predicate>();
176 template <const auto& GcGroup>
192 template <const auto& GcGroup>
195 return if_<_group_pred<GcGroup>>();
211 #endif // LEXY_DSL_CODE_POINT_HPP_INCLUDED
constexpr auto ascii() const
constexpr auto noncharacter() const
constexpr auto if_() const
constexpr bool is_control() const noexcept
static LEXY_CONSTEVAL auto char_class_name()
constexpr auto code_point
Matches a single unicode code point in the current unicode encoding.
constexpr bool is_ascii() const noexcept
constexpr void insert(int c)
constexpr auto value() const noexcept
constexpr bool is_noncharacter() const noexcept
LEXY_UNICODE_CONSTEXPR general_category_t general_category() const noexcept
constexpr bool is_bmp() const noexcept
constexpr auto range() const
static LEXY_CONSTEVAL auto char_class_ascii()
static constexpr bool char_class_match_cp([[maybe_unused]] char32_t cp)
constexpr auto set() const
constexpr const char * general_category_name(lexy::code_point::general_category_t category)
constexpr bool operator()(lexy::code_point cp) const
constexpr auto bmp() const
constexpr bool is_surrogate() const noexcept
constexpr bool is_private_use() const noexcept
constexpr auto general_category() const
static LEXY_CONSTEVAL auto name()