![]() |
Spicy
|
#include <assert.h>
Public Member Functions | |
Assert (::hilti::Expression expr, std::optional<::hilti::Expression > msg, Meta m=Meta()) | |
Assert (assert::Exception, ::hilti::Expression expr, std::optional< Type > excpt, std::optional<::hilti::Expression > msg, Meta m=Meta()) | |
bool | expectsException () const |
const auto & | expression () const |
auto | exception () const |
auto | message () const |
bool | operator== (const Assert &other) const |
auto | isEqual (const Statement &other) const |
auto | properties () const |
![]() | |
NodeBase (Meta meta) | |
NodeBase (std::vector< Node > childs, Meta meta) | |
template<typename T > | |
const T & | child (int i) const |
template<typename T > | |
void | assertChildIsA (int i) |
template<typename T > | |
std::vector< T > | childs (int begin, int end) const |
template<typename T > | |
std::vector< T > | childsOfType () const |
template<typename T > | |
auto | nodesOfType () const |
template<typename T > | |
auto | nodesOfType () |
void | addChild (Node n) |
auto & | childs () const |
auto & | childs () |
auto & | meta () const |
void | setMeta (Meta m) |
const NodeRef & | originalNode () const |
void | setOriginalNode (const NodeRef &n) |
void | clearCache () |
Static Public Member Functions | |
static Statement | setCondition (const Assert &e, const hilti::Expression &c) |
AST node for an assert statement.
|
inline |
Creates an assert statement that expects an exception to evaluate to true at runtime.
e | expression to evaluate at runtime |
msg | message to report an runtime if assertions fails |
m | meta informatio for AST node |
|
inline |
Creates an assert statement that expects an exception to occur when the expression is evaluated.
assert::Exception | tag to select this constructor |
e | expression to evaluate at runtime |
type | exception type that's expected to be thrown when e is evaluated; unset of any exception |
msg | message to report an runtime if assertions fails |
m | meta informatio for AST node |
|
inline |
Implements the Statement
interface.
|
inline |
Implements the Node
interface.
|
inlinestatic |
Returns a new assert
statement with the expression replaced.
e | original statement |
c | new expresssion |