9 #include <hilti/ast/id.h> 10 #include <hilti/ast/type.h> 23 const auto& id()
const {
return child<ID>(0); }
24 auto value()
const {
return _value; }
26 bool operator==(
const Label& other)
const {
return id() == other.id() && value() == other.value(); }
43 :
TypeBase(nodes(_normalizeLabels(std::move(l))), std::move(m)) {}
46 std::vector<enum_::Label> labels()
const {
return childs<enum_::Label>(0, -1); }
55 std::vector<enum_::Label> x = labels();
56 std::sort(x.begin(), x.end(), pred_gt);
57 x.erase(std::unique(x.begin(), x.end(), pred_eq), x.end());
61 std::optional<enum_::Label> label(
const ID&
id)
const {
62 for (
auto l : labels() ) {
70 bool operator==(
const Enum& other)
const {
71 if ( typeID() && other.
typeID() )
72 return *typeID() == *other.
typeID();
74 return labels() == other.labels();
78 auto isEqual(
const Type& other)
const {
return node::isEqual(
this, other); }
81 std::vector<Node> params;
82 for (
auto&& c : uniqueLabels() )
83 params.emplace_back(std::move(c));
93 static std::vector<enum_::Label> _normalizeLabels(std::vector<enum_::Label> );
95 bool _wildcard =
false;
std::vector< enum_::Label > uniqueLabels() const
Definition: enum.h:52
auto isEqual(const Type &other) const
Definition: enum.h:78
auto properties() const
Definition: enum.h:90
auto typeParameters() const
Definition: enum.h:80
auto properties() const
Definition: enum.h:29
Definition: type_erase.h:30
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:83
std::optional< ID > typeID() const
Definition: type.h:163
auto isWildcard() const
Definition: enum.h:87