Spicy
set_location.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <utility>
6 
7 #include <hilti/ast/expression.h>
8 #include <hilti/ast/meta.h>
9 #include <hilti/ast/node.h>
10 #include <hilti/ast/statement.h>
11 
12 namespace hilti::statement {
14 public:
15  SetLocation(hilti::Expression e, hilti::Meta m = hilti::Meta())
16  : hilti::NodeBase(hilti::nodes(std::move(e)), std::move(m)) {}
17 
18  auto expression() const { return children()[0].tryAs<hilti::Expression>(); }
19 
20  friend bool operator==(const SetLocation&, const SetLocation&) { return false; }
21 
22  // Statement interface.
23  auto isEqual(const hilti::Statement& other) const { return hilti::node::isEqual(this, other); }
24 
25  // Node interface.
26  auto properties() const { return hilti::node::Properties{}; }
27 };
28 } // namespace hilti::statement
Definition: set_location.h:13
const auto & children() const
Definition: node.h:472
Definition: meta.h:19
Definition: statement.h:14
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:98
Definition: node.h:360