8 #include <hilti/ast/attribute.h> 9 #include <hilti/ast/function.h> 11 #include <spicy/ast/aliases.h> 12 #include <spicy/ast/engine.h> 19 Hook(
const std::vector<type::function::Parameter>& params, std::optional<Statement> body, Engine engine,
20 std::optional<AttributeSet> attrs = {},
Meta m =
Meta())
23 std::move(body), hilti::function::CallingConvention::Standard, std::move(attrs), std::move(m)),
28 Engine engine()
const {
return _engine; }
29 bool isForEach()
const {
return AttributeSet::find(attributes(),
"foreach").has_value(); }
30 bool isDebug()
const {
return AttributeSet::find(attributes(),
"%debug").has_value(); }
32 std::optional<Expression> priority()
const {
34 return *p->valueAs<Expression>();
39 bool operator==(
const Hook& other)
const {
41 _engine == other._engine;
44 auto properties()
const {
return Function::properties() + node::Properties{{
"engine", to_string(_engine)}}; }
51 inline Node to_node(
Hook f) {
return Node(std::move(f)); }
Definition: function.h:69
Definition: function.h:44
std::optional< Attribute > find(std::string_view tag) const
Definition: attribute.h:190
auto properties() const
Definition: function.h:66