47 [[nodiscard]]
virtual bool found_else(parse_location _location)
noexcept
56 virtual void post_process(formula_post_process_context &context) {}
73 auto tmp = evaluate(context);
75 throw operation_error(std::format(
"{}: Found #break not inside a loop statement.", location));
77 }
else if (tmp.is_continue()) {
78 throw operation_error(std::format(
"{}: Found #continue not inside a loop statement.", location));
80 }
else if (tmp.is_undefined()) {
84 throw operation_error(std::format(
"{}: Found #return not inside a function.", location));
90 auto context = formula_evaluation_context{};
91 return evaluate_output(context);
94 [[nodiscard]]
virtual std::string string() const noexcept
96 return "<skeleton_node>";
111 if (ssize(children) > 0 && new_child->should_left_align()) {
112 children.back()->left_align();
114 children.push_back(
std::move(new_child));
117 [[nodiscard]]
static datum evaluate_formula_without_output(
118 formula_evaluation_context &context,
119 formula_node
const &expression,
120 parse_location
const &location)
123 return expression.evaluate_without_output(context);
126 throw operation_error(std::format(
"{}: Could not evaluate.\n{}", location, e.
what()));
130 [[nodiscard]]
static datum
131 evaluate_expression(formula_evaluation_context &context, formula_node
const &expression, parse_location
const &location)
134 return expression.evaluate(context);
137 throw operation_error(std::format(
"{}: Could not evaluate expression.\n{}", location, e.
what()));
142 post_process_expression(formula_post_process_context &context, formula_node &expression, parse_location
const &location)
145 return expression.post_process(context);
148 throw operation_error(std::format(
"{}: Could not post-process expression.\n{}", location, e.
what()));
152 [[nodiscard]]
static datum evaluate_children(formula_evaluation_context &context, statement_vector
const &children)
154 for (
hilet &child : children) {
155 hilet tmp = child->evaluate(context);
156 if (!tmp.is_undefined()) {
virtual bool append(std::unique_ptr< skeleton_node > x) noexcept
Append a template-piece to the current template.
Definition skeleton_node.hpp:27