7#include "skeleton_node.hpp"
13 statement_vector children;
21 name = name_expression->get_name();
23 super_function = context.set_function(name,
25 return this->evaluate_call(context, arguments);
38 if (std::ssize(children) > 0) {
39 children.back()->left_align();
42 function = context.get_function(name);
45 context.push_super(super_function);
46 for (ttlet &child: children) {
47 child->post_process(context);
62 throw operation_error(
"{}: Found #break not inside a loop statement.", location);
65 throw operation_error(
"{}: Found #continue not inside a loop statement.", location);
71 throw operation_error(
"{}: Can not use a #return statement inside a #block.", location);
77 auto tmp = evaluate_children(context, children);
81 throw operation_error(
"{}: Found #break not inside a loop statement.", location);
83 }
else if (tmp.is_continue()) {
84 throw operation_error(
"{}: Found #continue not inside a loop statement.", location);
86 }
else if (tmp.is_undefined()) {
90 throw operation_error(
"{}: Can not use a #return statement inside a #block.", location);
A dynamic data type.
Definition datum.hpp:213
constexpr bool is_continue() const noexcept
Check if the result of a expression was a continue flow control statement.
Definition datum.hpp:638
constexpr bool is_break() const noexcept
Check if the result of a expression was a break flow control statement.
Definition datum.hpp:630
constexpr bool is_undefined() const noexcept
Check if the datum has an undefined value.
Definition datum.hpp:622
Exception thrown during execution of a dynamic operation.
Definition exception.hpp:42
Definition formula_evaluation_context.hpp:16
Definition formula_post_process_context.hpp:19
Definition parse_location.hpp:17
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:32
datum evaluate(formula_evaluation_context &context) override
Evaluate the template.
Definition skeleton_block_node.hpp:52
Definition skeleton_node.hpp:16