scriptlang: rember to save last token

This commit is contained in:
SimonFJ20 2023-01-09 20:46:42 +01:00
parent f7077274fe
commit ca6fde3c0b

View File

@ -107,9 +107,11 @@ private:
-> Result<TokenTypes, void>;
[[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
{