7#include "skeleton_node.hpp"
9namespace hi::inline
v1 {
13 statement_vector children;
24 name = name_expression->get_name();
28 return this->evaluate_call(context, arguments);
42 if (ssize(children) > 0) {
43 children.back()->left_align();
46 function = context.get_function(name);
49 context.push_super(super_function);
50 for (
hilet &child : children) {
51 child->post_process(context);
63 throw operation_error(std::format(
"{}: Could not evaluate block.\n{}", location, e.
what()));
67 throw operation_error(std::format(
"{}: Found #break not inside a loop statement.", location));
70 throw operation_error(std::format(
"{}: Found #continue not inside a loop statement.", location));
76 throw operation_error(std::format(
"{}: Can not use a #return statement inside a #block.", location));
83 auto tmp = evaluate_children(context, children);
87 throw operation_error(std::format(
"{}: Found #break not inside a loop statement.", location));
89 }
else if (tmp.is_continue()) {
90 throw operation_error(std::format(
"{}: Found #continue not inside a loop statement.", location));
92 }
else if (tmp.is_undefined()) {
96 throw operation_error(std::format(
"{}: Can not use a #return statement inside a #block.", location));
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:15
A dynamic data type.
Definition datum.hpp:224
constexpr bool is_break() const noexcept
Check if the result of a expression was a break flow control statement.
Definition datum.hpp:700
constexpr bool is_continue() const noexcept
Check if the result of a expression was a continue flow control statement.
Definition datum.hpp:708
constexpr bool is_undefined() const noexcept
Check if the datum has an undefined value.
Definition datum.hpp:692
Definition formula_evaluation_context.hpp:16
Definition formula_post_process_context.hpp:19
Definition functional.hpp:14
Definition parse_location.hpp:18
Definition skeleton_block_node.hpp:11
bool append(std::unique_ptr< skeleton_node > x) noexcept override
Append a template-piece to the current template.
Definition skeleton_block_node.hpp:34
datum evaluate(formula_evaluation_context &context) override
Evaluate the template.
Definition skeleton_block_node.hpp:56
Definition skeleton_node.hpp:16