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