7#include "formula_node.hpp"
9namespace hi::inline
v1 {
25 lhs->resolve_function_pointer(context);
26 for (
auto &arg : args) {
27 arg->post_process(context);
33 hilet args_ = transform<datum::vector_type>(args, [&](
hilet &x) {
34 return x->evaluate(context);
37 return lhs->call(context, args_);
46 }
catch (parse_error
const &e) {
47 throw parse_error(std::format(
"Function definition does not have a name, got {}\n{}", *lhs, e.what()));
50 for (
hilet &arg : args) {
53 }
catch (parse_error
const &e) {
54 throw parse_error(std::format(
"Definition of function {}() has a non-name argument {}\n{}", *lhs, *arg, e.what()));
63 auto s = std::format(
"({}(", *lhs);
65 for (
hilet &arg : args) {
#define hi_assert(expression,...)
Assert if expression is true.
Definition assert.hpp:87
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:15
A dynamic data type.
Definition datum.hpp:224
A temporary node used during parsing.
Definition formula_arguments.hpp:13
Definition formula_call_node.hpp:11
void post_process(formula_post_process_context &context) override
Resolve function and method pointers.
Definition formula_call_node.hpp:23
datum evaluate(formula_evaluation_context &context) const override
Evaluate an rvalue.
Definition formula_call_node.hpp:31
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:40
Definition formula_evaluation_context.hpp:16
Definition formula_node.hpp:29
Definition formula_post_process_context.hpp:19
Definition parse_location.hpp:18