diff --git a/scriptlang/lexer.hpp b/scriptlang/lexer.hpp index d2a2cff..b052b63 100644 --- a/scriptlang/lexer.hpp +++ b/scriptlang/lexer.hpp @@ -107,9 +107,11 @@ private: -> Result; [[nodiscard]] auto constexpr inline token( - TokenTypes type, size_t begin) const noexcept -> Token + TokenTypes type, size_t begin) noexcept -> Token { - return Token { type, begin, index - begin, line, column }; + auto token = Token { type, begin, index - begin, line, column }; + last_token = token; + return token; } [[nodiscard]] auto constexpr inline done() const noexcept -> bool {