HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
skeleton_expression_node.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 "skeleton_node.hpp"
8
9namespace tt {
10
13
15 skeleton_node(std::move(location)), expression(std::move(expression)) {}
16
17 void post_process(formula_post_process_context &context) override {
18 post_process_expression(context, *expression, location);
19 }
20
21 std::string string() const noexcept override {
22 return fmt::format("<expression {}>", *expression);
23 }
24
26 ttlet tmp = evaluate_formula_without_output(context, *expression, location);
27 if (tmp.is_break()) {
28 tt_error_info().set<"parse_location">(location);
29 throw operation_error("Found #break not inside a loop statement.");
30
31 } else if (tmp.is_continue()) {
32 tt_error_info().set<"parse_location">(location);
33 throw operation_error("Found #continue not inside a loop statement.");
34
35 } else {
36 return {};
37 }
38 }
39};
40
41}
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_expression_node.hpp:11
datum evaluate(formula_evaluation_context &context) override
Evaluate the template.
Definition skeleton_expression_node.hpp:25
Definition skeleton_node.hpp:16
T move(T... args)