7 #include <hilti/ast/expression.h> 8 #include <hilti/ast/statement.h> 30 Assert(::hilti::Expression expr, std::optional<::hilti::Expression> msg,
Meta m =
Meta())
44 std::optional<::hilti::Expression> msg,
Meta m =
Meta())
45 :
NodeBase(nodes(
std::move(expr),
std::move(excpt),
std::move(msg)),
std::move(m)), _expects_exception(true) {}
47 bool expectsException()
const {
return _expects_exception; }
48 const auto& expression()
const {
return child<::hilti::Expression>(0); }
49 auto exception()
const {
return children()[1].tryAs<
Type>(); }
50 auto message()
const {
return children()[2].tryAs<::hilti::Expression>(); }
52 void setCondition(
const hilti::Expression& c) { children()[0] = c; }
54 bool operator==(
const Assert& other)
const {
55 return _expects_exception == other._expects_exception && expression() == other.expression() &&
56 exception() == other.exception() && message() == other.message();
60 auto isEqual(
const Statement& other)
const {
return node::isEqual(
this, other); }
66 bool _expects_exception =
false;
Assert(::hilti::Expression expr, std::optional<::hilti::Expression > msg, Meta m=Meta())
Definition: assert.h:30
auto isEqual(const Statement &other) const
Definition: assert.h:60
auto properties() const
Definition: assert.h:63
Definition: optional.h:79
Assert(assert::Exception, ::hilti::Expression expr, std::optional< Type > excpt, std::optional<::hilti::Expression > msg, Meta m=Meta())
Definition: assert.h:43
Definition: statement.h:14
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:97