2022-11-04 17:02:37 +00:00
|
|
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
2023-02-03 12:34:12 +00:00
|
|
|
#include "Luau/Refinement.h"
|
2022-11-04 17:02:37 +00:00
|
|
|
|
|
|
|
namespace Luau
|
|
|
|
{
|
|
|
|
|
2023-03-03 13:45:38 +00:00
|
|
|
RefinementId RefinementArena::variadic(const std::vector<RefinementId>& refis)
|
|
|
|
{
|
|
|
|
return NotNull{allocator.allocate(Variadic{refis})};
|
|
|
|
}
|
|
|
|
|
2023-02-03 12:34:12 +00:00
|
|
|
RefinementId RefinementArena::negation(RefinementId refinement)
|
2022-11-04 17:02:37 +00:00
|
|
|
{
|
2023-02-03 12:34:12 +00:00
|
|
|
return NotNull{allocator.allocate(Negation{refinement})};
|
2022-11-04 17:02:37 +00:00
|
|
|
}
|
|
|
|
|
2023-02-03 12:34:12 +00:00
|
|
|
RefinementId RefinementArena::conjunction(RefinementId lhs, RefinementId rhs)
|
2022-11-04 17:02:37 +00:00
|
|
|
{
|
|
|
|
return NotNull{allocator.allocate(Conjunction{lhs, rhs})};
|
|
|
|
}
|
|
|
|
|
2023-02-03 12:34:12 +00:00
|
|
|
RefinementId RefinementArena::disjunction(RefinementId lhs, RefinementId rhs)
|
2022-11-04 17:02:37 +00:00
|
|
|
{
|
|
|
|
return NotNull{allocator.allocate(Disjunction{lhs, rhs})};
|
|
|
|
}
|
|
|
|
|
2023-02-03 12:34:12 +00:00
|
|
|
RefinementId RefinementArena::equivalence(RefinementId lhs, RefinementId rhs)
|
2022-11-04 17:02:37 +00:00
|
|
|
{
|
|
|
|
return NotNull{allocator.allocate(Equivalence{lhs, rhs})};
|
|
|
|
}
|
|
|
|
|
2023-03-03 13:45:38 +00:00
|
|
|
RefinementId RefinementArena::proposition(BreadcrumbId breadcrumb, TypeId discriminantTy)
|
2022-11-04 17:02:37 +00:00
|
|
|
{
|
2023-03-03 13:45:38 +00:00
|
|
|
return NotNull{allocator.allocate(Proposition{breadcrumb, discriminantTy})};
|
2023-02-10 18:50:54 +00:00
|
|
|
}
|
|
|
|
|
2022-11-04 17:02:37 +00:00
|
|
|
} // namespace Luau
|