15 template <
char... C>
struct token {
16 static const size_t size =
sizeof...(C);
31 std::string::const_iterator
const &it) {
32 return ((*(it + I) == C) && ...);
36 template <
class Token>
43 template <
char... C> constexpr
bool match_any(
char c) {
44 return ((C == c) || ...);
49 template <
char C0,
char C1> constexpr
bool match_range(
char c) {
50 return (c >= C0) && (c <= C1);
constexpr bool match_range(char c)
Definition: tokens.hpp:49
static const size_t size
Definition: tokens.hpp:16
constexpr bool match_any(char c)
Check if the given character matches any of the template arguments.
Definition: tokens.hpp:43
Template to define new tokens.
Definition: tokens.hpp:15
bool match_token(std::string::const_iterator const &it)
Check if the iterator at the current position matches the token.
Definition: tokens.hpp:37
Syntax tokens.
Definition: tokens.hpp:12
bool match_token_impl(token< C... >, std::index_sequence< I... >, std::string::const_iterator const &it)
Check if the iterator at the current position matches the token.
Definition: tokens.hpp:30