Use string_view instead of string in Token

This commit is contained in:
Abdelrahman Said 2025-06-08 15:10:38 +01:00
parent 1a0207687c
commit 74b7cf9f89

View File

@ -3,6 +3,7 @@
#include "object.hh" #include "object.hh"
#include <cstdint> #include <cstdint>
#include <string> #include <string>
#include <string_view>
enum class TokenType : uint8_t { enum class TokenType : uint8_t {
// Single-character tokens. // Single-character tokens.
@ -31,7 +32,7 @@ struct Token {
{}; {};
TokenType type; TokenType type;
std::string lexeme; std::string_view lexeme;
Object literal; Object literal;
int line; int line;
}; };