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