39 [[nodiscard]]
virtual bool found_else(parse_location _location)
noexcept {
return false;}
42 virtual void post_process(formula_post_process_context &context) {}
59 throw operation_error(
"{}: Found #break not inside a loop statement.", location);
61 }
else if (tmp.is_continue()) {
62 throw operation_error(
"{}: Found #continue not inside a loop statement.", location);
64 }
else if (tmp.is_undefined()) {
68 throw operation_error(
"{}: Found #return not inside a function.", location);
73 auto context = formula_evaluation_context{};
74 return evaluate_output(context);
77 [[nodiscard]]
virtual std::string string() const noexcept {
78 return "<skeleton_node>";
81 [[nodiscard]]
friend std::string to_string(skeleton_node
const &lhs)
noexcept {
86 return lhs << to_string(rhs);
90 if (std::ssize(children) > 0 && new_child->should_left_align()) {
91 children.back()->left_align();
96 [[nodiscard]]
static datum evaluate_formula_without_output(formula_evaluation_context &context, formula_node
const &expression, parse_location
const &location) {
98 return expression.evaluate_without_output(context);
101 throw operation_error(
"{}: Could not evaluate.\n{}", location, e.
what());
105 [[nodiscard]]
static datum evaluate_expression(formula_evaluation_context &context, formula_node
const &expression, parse_location
const &location) {
107 return expression.evaluate(context);
110 throw operation_error(
"{}: Could not evaluate expression.\n{}", location, e.
what());
114 static void post_process_expression(formula_post_process_context &context, formula_node &expression, parse_location
const &location) {
116 return expression.post_process(context);
119 throw operation_error(
"{}: Could not post-process expression.\n{}", location, e.
what());
123 [[nodiscard]]
static datum evaluate_children(formula_evaluation_context &context, statement_vector
const &children) {
124 for (ttlet &child: children) {
125 ttlet tmp = child->evaluate(context);
126 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:28