Use string_view instead of string in Token
This commit is contained in:
parent
1a0207687c
commit
74b7cf9f89
@ -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;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user