7#include "formula_node.hpp"
23 tt_assert(rhs_ !=
nullptr);
28 lhs->resolve_function_pointer(context);
29 for (
auto &arg: args) {
30 arg->post_process(context);
35 ttlet args_ = transform<datum::vector>(args, [&](ttlet& x) {
36 return x->evaluate(context);
39 return lhs->call(context, args_);
48 throw parse_error(fmt::format(
"Function definition does not have a name, got {}\n{}", lhs, to_string(e,
false)));
51 for (ttlet &arg: args) {
55 throw parse_error(fmt::format(
"Definition of function {}() has a non-name argument {}\n{}", lhs, arg, to_string(e,
false)));
63 auto s = fmt::format(
"({}(", *lhs);
65 for (ttlet &arg: args) {
Exception thrown during parsing on an error.
Definition exception.hpp:21
A temporary node used during parsing.
Definition formula_arguments.hpp:13
Definition formula_call_node.hpp:11
std::vector< std::string > get_name_and_argument_names() const override
Get name and argument names from a function declaration.
Definition formula_call_node.hpp:42
void post_process(formula_post_process_context &context) override
Resolve function and method pointers.
Definition formula_call_node.hpp:27
datum evaluate(formula_evaluation_context &context) const override
Evaluate an rvalue.
Definition formula_call_node.hpp:34
Definition formula_evaluation_context.hpp:16
Definition formula_node.hpp:20
Definition formula_post_process_context.hpp:18
Definition parse_location.hpp:16