HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
formula.hpp
1// Copyright Take Vos 2020-2021.
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#include "formula_post_process_context.hpp"
9#include "formula_parse_context.hpp"
10#include <string>
11#include <string_view>
12#include <memory>
13
14namespace hi::inline v1 {
15
20
24inline std::unique_ptr<formula_node> parse_formula(std::string_view::const_iterator first, std::string_view::const_iterator last)
25{
26 auto parse_context = formula_parse_context(first, last);
27 auto e = parse_formula(parse_context);
28
29 auto post_process_context = formula_post_process_context();
30 e->post_process(post_process_context);
31 return e;
32}
33
38{
39 return parse_formula(text.cbegin(), text.cend());
40}
41
49std::string_view::const_iterator find_end_of_formula(
50 std::string_view::const_iterator first,
51 std::string_view::const_iterator last,
52 std::string_view terminating_string);
53
54} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:13
std::unique_ptr< formula_node > parse_formula(formula_parse_context &context)
Parse an formula.
std::string_view::const_iterator find_end_of_formula(std::string_view::const_iterator first, std::string_view::const_iterator last, std::string_view terminating_string)
Find the end of an formula.
Definition formula_parse_context.hpp:14
Definition formula_post_process_context.hpp:19
A variant of text.
Definition label.hpp:31