Fixed duplicated utils.hpp

This commit is contained in:
WerWolv
2020-12-27 15:54:12 +01:00
parent f74eff8934
commit 144e30775f
9 changed files with 174 additions and 248 deletions

View File

@@ -67,5 +67,21 @@ namespace hex::lang {
} typeToken;
u32 lineNumber;
[[nodiscard]] constexpr static inline bool isUnsigned(const TypeToken::Type type) {
return (static_cast<u32>(type) & 0x0F) == 0x00;
}
[[nodiscard]] constexpr static inline bool isSigned(const TypeToken::Type type) {
return (static_cast<u32>(type) & 0x0F) == 0x01;
}
[[nodiscard]] constexpr static inline bool isFloatingPoint(const TypeToken::Type type) {
return (static_cast<u32>(type) & 0x0F) == 0x02;
}
[[nodiscard]] constexpr static inline u32 getTypeSize(const TypeToken::Type type) {
return static_cast<u32>(type) >> 4;
}
};
}