HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
formula_arguments.hpp
1// Copyright Take Vos 2020.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "formula_node.hpp"
8
9namespace hi::inline v1 {
10
14 formula_vector args;
15
16 formula_arguments(parse_location location, formula_vector args) : formula_node(std::move(location)), args(std::move(args)) {}
17
19 formula_node(std::move(location))
20 {
21 args.push_back(std::move(arg1));
22 args.push_back(std::move(arg2));
23 }
24
25 datum evaluate(formula_evaluation_context &context) const override
26 {
27 return {};
28 };
29
30 std::string string() const noexcept override
31 {
32 std::string s = "<args ";
33 int i = 0;
34 for (hilet &arg : args) {
35 if (i++ > 0) {
36 s += ", ";
37 }
38 s += arg->string();
39 }
40 return s + ">";
41 }
42};
43
44} // namespace hi::inline v1
#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
datum evaluate(formula_evaluation_context &context) const override
Evaluate an rvalue.
Definition formula_arguments.hpp:25
Definition formula_evaluation_context.hpp:16
Definition formula_node.hpp:29
Definition parse_location.hpp:18
T move(T... args)