mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-07 12:20:53 +01:00
Move the macros to be at the top.
This commit is contained in:
parent
56d4f52434
commit
b25df642da
1 changed files with 19 additions and 26 deletions
|
@ -9,32 +9,6 @@
|
|||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace Luau::EqSat
|
||||
{
|
||||
|
||||
template<typename T, typename = void>
|
||||
struct LanguageHash
|
||||
{
|
||||
size_t operator()(const T&) const
|
||||
{
|
||||
// See available specializations at the bottom of this file.
|
||||
static_assert(false, "missing languageHash specialization");
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
std::size_t languageHash(const T& lang)
|
||||
{
|
||||
return LanguageHash<T>{}(lang);
|
||||
}
|
||||
|
||||
// We have four different kinds of declarations:
|
||||
//
|
||||
// Atom, the root data type that holds the value in question.
|
||||
// NodeArray, a fixed sized sequence of `Id`s.
|
||||
// NodeVector, a dynamically sized sequence of `Id`s.
|
||||
// NodeFields, a fixed sized sequence of `Id`s accessed by field names rather than subscripts.
|
||||
|
||||
#define LUAU_EQSAT_ATOM(name, t) \
|
||||
struct name : public ::Luau::EqSat::Atom<name, t> \
|
||||
{ \
|
||||
|
@ -68,6 +42,25 @@ std::size_t languageHash(const T& lang)
|
|||
using NodeFields::NodeFields; \
|
||||
}
|
||||
|
||||
namespace Luau::EqSat
|
||||
{
|
||||
|
||||
template<typename T, typename = void>
|
||||
struct LanguageHash
|
||||
{
|
||||
size_t operator()(const T&) const
|
||||
{
|
||||
// See available specializations at the bottom of this file.
|
||||
static_assert(false, "missing languageHash specialization");
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
std::size_t languageHash(const T& lang)
|
||||
{
|
||||
return LanguageHash<T>{}(lang);
|
||||
}
|
||||
|
||||
template<typename Phantom, typename T>
|
||||
struct Atom
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue