Use string_view instead of string in Token
This commit is contained in:
		@@ -3,6 +3,7 @@
 | 
			
		||||
#include "object.hh"
 | 
			
		||||
#include <cstdint>
 | 
			
		||||
#include <string>
 | 
			
		||||
#include <string_view>
 | 
			
		||||
 | 
			
		||||
enum class TokenType : uint8_t {
 | 
			
		||||
  // Single-character tokens.
 | 
			
		||||
@@ -31,7 +32,7 @@ struct Token {
 | 
			
		||||
  {};
 | 
			
		||||
 | 
			
		||||
  TokenType type;
 | 
			
		||||
  std::string lexeme;
 | 
			
		||||
  std::string_view lexeme;
 | 
			
		||||
  Object literal;
 | 
			
		||||
  int line;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user