7#include "formula_binary_operator_node.hpp"
19 if (rhs_name ==
nullptr) {
20 tt_error_info().set<
"parse_location">(location);
21 throw parse_error(
"Expecting a name token on the right hand side of a member accessor. got {}.", rhs);
26 method = context.get_method(rhs_name->name);
28 tt_error_info().set<
"parse_location">(location);
29 throw parse_error(
"Could not find method .{}().", rhs_name->name);
34 if (lhs->has_evaluate_xvalue()) {
35 ttlet &lhs_ = lhs->evaluate_xvalue(context);
37 if (!lhs_.contains(rhs_name->name)) {
38 tt_error_info().set<
"parse_location">(location);
42 return lhs_[rhs_name->name];
49 ttlet lhs_ = lhs->evaluate(context);
51 if (!lhs_.contains(rhs_name->name)) {
52 tt_error_info().set<
"parse_location">(location);
56 return lhs_[rhs_name->name];
65 auto &lhs_ = lhs->evaluate_lvalue(context);
67 return lhs_[rhs_name->name];
75 auto &lhs_ = lhs->evaluate_lvalue(context);
77 return method(context, lhs_, arguments);
85 return fmt::format(
"({} . {})", *lhs, *rhs);
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 parsing on an error.
Definition exception.hpp:21
Exception thrown during execution of a dynamic operation.
Definition exception.hpp:37
Definition formula_binary_operator_node.hpp:11
Definition formula_evaluation_context.hpp:16
Definition formula_member_node.hpp:11
void resolve_function_pointer(formula_post_process_context &context) override
Resolve function and method pointers.
Definition formula_member_node.hpp:25
datum & evaluate_lvalue(formula_evaluation_context &context) const override
Evaluate an existing lvalue.
Definition formula_member_node.hpp:64
datum evaluate(formula_evaluation_context &context) const override
Evaluate an rvalue.
Definition formula_member_node.hpp:33
datum call(formula_evaluation_context &context, datum::vector const &arguments) const override
Call a function with a datum::vector as arguments.
Definition formula_member_node.hpp:74
Definition formula_name_node.hpp:11
Definition formula_post_process_context.hpp:18
Definition parse_location.hpp:16