diff --git a/argon/lang/scanner/scanner.cpp b/argon/lang/scanner/scanner.cpp index 3c9604d1..0560b41d 100644 --- a/argon/lang/scanner/scanner.cpp +++ b/argon/lang/scanner/scanner.cpp @@ -732,6 +732,7 @@ bool Scanner::NextToken(Token *out_token) noexcept { this->peeked.type = TokenType::TK_NULL; this->peeked.buffer = nullptr; + this->peeked.length = 0; return true; } diff --git a/argon/lang/scanner/token.h b/argon/lang/scanner/token.h index 595aafdd..6fccd585 100644 --- a/argon/lang/scanner/token.h +++ b/argon/lang/scanner/token.h @@ -187,6 +187,7 @@ namespace argon::lang::scanner { this->loc = other.loc; other.buffer = nullptr; + other.length = 0; return *this; }