Compiles on UNIX based systems
This commit is contained in:
@@ -83,11 +83,20 @@ namespace LXC::Lexer
|
||||
};
|
||||
|
||||
// Util function calculating wether a token is of a given class //
|
||||
template<TokenClass::ClassMask mask> static constexpr bool IsTypeClass(TokenType type) { return type & mask; }
|
||||
template<TokenClass::ClassMask mask> static constexpr bool IsTypeClass(Token token) { return token.type & mask; }
|
||||
template<TokenClass::ClassMask mask> static constexpr bool IsTypeClass(TokenType type)
|
||||
{
|
||||
using T = std::underlying_type_t<TokenType>;
|
||||
return static_cast<T>(type) & static_cast<T>(mask);
|
||||
}
|
||||
|
||||
template<TokenClass::ClassMask mask> static constexpr bool IsTypeClass(Token token)
|
||||
{
|
||||
using T = std::underlying_type_t<TokenType>;
|
||||
return static_cast<T>(token.type) & static_cast<T>(mask);
|
||||
}
|
||||
|
||||
// Constructor to set the data of the token for more complex token types //
|
||||
Token(const LexerContext& ctx, unsigned __int32 start, unsigned short len, TokenType _type);
|
||||
Token(const LexerContext& ctx, uint32_t start, unsigned short len, TokenType _type);
|
||||
|
||||
// Deconstructor to clean up the allocated memory //
|
||||
~Token();
|
||||
@@ -105,7 +114,7 @@ namespace LXC::Lexer
|
||||
const unsigned short length;
|
||||
|
||||
// Start index of the token //
|
||||
const unsigned __int32 index;
|
||||
const uint32_t index;
|
||||
|
||||
private:
|
||||
// The data of the token //
|
||||
|
||||
Reference in New Issue
Block a user