9 #include <hilti/ast/ctor.h> 10 #include <hilti/ast/expression.h> 11 #include <hilti/ast/types/auto.h> 12 #include <hilti/ast/types/tuple.h> 13 #include <hilti/ast/types/unknown.h> 21 Tuple(std::vector<Expression> v,
Meta m =
Meta()) :
NodeBase(nodes(_inferType(v), v), std::move(m)) {}
23 auto value()
const {
return children<Expression>(1, -1); }
27 bool operator==(
const Tuple& other)
const {
return value() == other.value(); }
30 const auto&
type()
const {
return child<Type>(0); }
37 if ( value().empty() )
40 for (
const auto& e : value() ) {
51 auto isEqual(
const Ctor& other)
const {
return node::isEqual(
this, other); }
56 Type _inferType(
const std::vector<Expression>& exprs) {
57 for (
const auto& e : exprs ) {
58 if ( ! expression::isResolved(e) )
62 std::vector<Type> types;
63 for (
const auto& e : exprs )
64 types.push_back(e.type());
auto isLhs() const
Definition: tuple.h:36
const auto & children() const
Definition: node.h:470
const auto & type() const
Definition: tuple.h:30
auto isTemporary() const
Definition: tuple.h:49
auto properties() const
Definition: tuple.h:53
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:99
bool isConstant() const
Definition: tuple.h:33
auto isEqual(const Ctor &other) const
Definition: tuple.h:51
auto & meta() const
Definition: node.h:474