mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-10 22:00:54 +01:00
Make operands be usable in const context.
This commit is contained in:
parent
7ba2821982
commit
fd810237c3
1 changed files with 17 additions and 2 deletions
|
@ -87,6 +87,11 @@ public:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Slice<Id> operands() const
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
bool operator==(const Atom& rhs) const
|
bool operator==(const Atom& rhs) const
|
||||||
{
|
{
|
||||||
return _value == rhs._value;
|
return _value == rhs._value;
|
||||||
|
@ -126,7 +131,12 @@ struct NodeVector
|
||||||
public:
|
public:
|
||||||
Slice<Id> operands()
|
Slice<Id> operands()
|
||||||
{
|
{
|
||||||
return {vector.data(), vector.size()};
|
return Slice{vector.data(), vector.size()};
|
||||||
|
}
|
||||||
|
|
||||||
|
Slice<const Id> operands() const
|
||||||
|
{
|
||||||
|
return Slice{vector.data(), vector.size()};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const NodeVector& rhs) const
|
bool operator==(const NodeVector& rhs) const
|
||||||
|
@ -193,6 +203,11 @@ public:
|
||||||
return Slice{array};
|
return Slice{array};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Slice<Id> operands() const
|
||||||
|
{
|
||||||
|
return Slice{array};
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
const Id& field() const
|
const Id& field() const
|
||||||
{
|
{
|
||||||
|
@ -306,7 +321,7 @@ public:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Language(T&& t, std::enable_if_t<WithinDomain<T>::value>* = 0) noexcept
|
Language(T&& t, std::enable_if_t<WithinDomain<T>::value>* = 0) noexcept
|
||||||
{
|
{
|
||||||
tag = T::tag;
|
tag = std::decay_t<T>::tag;
|
||||||
new (&buffer) std::decay_t<T>(std::forward<T>(t));
|
new (&buffer) std::decay_t<T>(std::forward<T>(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue