Use string_view instead of string in Token
This commit is contained in:
		@@ -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;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user