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