#pragma once #include #include #include #include #include namespace hex::pl { class Lexer { public: Lexer() = default; std::optional> lex(const std::string &code); const std::optional &getError() { return this->m_error; } private: std::optional m_error; [[noreturn]] static void throwLexerError(const std::string &error, u32 lineNumber) { throw PatternLanguageError(lineNumber, "Lexer: " + error); } }; }