1#ifndef CODEX_LUA_LEXER_H
2#define CODEX_LUA_LEXER_H
11 "abcdefghijklmnopqrstuvwxyz"
12 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
18 s =
s.substr(
s.find_first_not_of(
SPACE));
22 auto i = std::ranges::find(
s,
'\n');
29constexpr std::string_view
consume(std::string_view
s, std::string_view
c) {
31 throw "invalid prefix";
32 return s.substr(
c.size());
35template<fixed_
string s>
37 return std::ranges::find(
s,
c) !=
s.
end();
42 throw "pattern not matched";
46template<fixed_
string p>
51template<fixed_
string p>
constexpr std::string_view consume_set(std::string_view s)
Definition lexer.hpp:47
constexpr fixed_string DIGITS
Definition lexer.hpp:8
constexpr bool set_contains(char c)
Definition lexer.hpp:36
constexpr fixed_string SPACE
Definition lexer.hpp:6
constexpr fixed_string IDENT0
Definition lexer.hpp:10
constexpr std::string_view ignore_interm(std::string_view s)
Definition lexer.hpp:17
constexpr std::string_view consume(std::string_view s, std::string_view c)
Definition lexer.hpp:29
constexpr fixed_string IDENT1
Definition lexer.hpp:15
constexpr std::string_view consume_set_comp(std::string_view s)
Definition lexer.hpp:52
constexpr std::string_view consume_set_common(std::string_view s, auto i)
Definition lexer.hpp:40
constexpr const char * end(void) const
Definition utils.hpp:20
constexpr fixed_string s
Definition test.cpp:6
constexpr auto slice(std::string_view s, std::size_t b, std::size_t e)
Definition utils.hpp:74