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);
58 auto error_location = location;
59 if (ttlet location_in_function = error_info::peek<parse_location, "parse_location">()) {
60 error_location += *location_in_function;
67 tt_error_info().set<
"parse_location">(location);
70 }
else if (tmp.is_continue()) {
71 tt_error_info().set<
"parse_location">(location);
74 }
else if (tmp.is_undefined()) {
78 tt_error_info().set<
"parse_location">(location);
79 throw operation_error(
"Can not use a #return statement inside a #block.");
85 auto tmp = evaluate_children(context, children);
89 tt_error_info().set<
"parse_location">(location);
92 }
else if (tmp.is_continue()) {
93 tt_error_info().set<
"parse_location">(location);
94 throw operation_error(
"Found #continue not inside a loop statement.");
96 }
else if (tmp.is_undefined()) {
100 tt_error_info().set<
"parse_location">(location);
101 throw operation_error(
"Can not use a #return statement inside a #block.");
Error information passed alongside an error code or exception.
Definition error_info.hpp:81
error_info & set(Arg &&value) noexcept
Set an information for a given tag.
Definition error_info.hpp:144
Exception thrown during execution of a dynamic operation.
Definition exception.hpp:37
Definition formula_evaluation_context.hpp:16
Definition formula_post_process_context.hpp:18
Definition parse_location.hpp:16
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