39 [[nodiscard]]
virtual bool found_else(parse_location _location)
noexcept {
return false;}
42 virtual void post_process(formula_post_process_context &context) {}
59 tt_error_info().set<
"parse_location">(location);
62 }
else if (tmp.is_continue()) {
63 tt_error_info().set<
"parse_location">(location);
64 throw operation_error(
"Found #continue not inside a loop statement.");
66 }
else if (tmp.is_undefined()) {
70 tt_error_info().set<
"parse_location">(location);
71 throw operation_error(
"Found #return not inside a function.");
76 auto context = formula_evaluation_context{};
77 return evaluate_output(context);
80 [[nodiscard]]
virtual std::string string() const noexcept {
81 return "<skeleton_node>";
84 [[nodiscard]]
friend std::string to_string(skeleton_node
const &lhs)
noexcept {
89 return lhs << to_string(rhs);
93 if (std::ssize(children) > 0 && new_child->should_left_align()) {
94 children.back()->left_align();
99 [[nodiscard]]
static datum evaluate_formula_without_output(formula_evaluation_context &context, formula_node
const &expression, parse_location
const &location) {
101 return expression.evaluate_without_output(context);
104 auto error_location = location;
105 if (ttlet evaluation_location = error_info::peek<parse_location, "parse_location">()) {
106 error_location += *evaluation_location;
108 error_info(
true).set<
"parse_location">(error_location);
113 [[nodiscard]]
static datum evaluate_expression(formula_evaluation_context &context, formula_node
const &expression, parse_location
const &location) {
115 return expression.evaluate(context);
118 auto error_location = location;
119 if (ttlet evaluation_location = error_info::peek<parse_location, "parse_location">()) {
120 error_location += *evaluation_location;
122 error_info(
true).set<
"parse_location">(error_location);
127 static void post_process_expression(formula_post_process_context &context, formula_node &expression, parse_location
const &location) {
129 return expression.post_process(context);
132 auto error_location = location;
133 if (ttlet evaluation_location = error_info::peek<parse_location, "parse_location">()) {
134 error_location += *evaluation_location;
136 error_info(
true).set<
"parse_location">(error_location);
142 [[nodiscard]]
static datum evaluate_children(formula_evaluation_context &context, statement_vector
const &children) {
143 for (ttlet &child: children) {
144 ttlet tmp = child->evaluate(context);
145 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