7#include "skeleton_node.hpp"
21 auto new_text_length = std::ssize(text);
22 for (
auto i = text.crbegin(); i != text.crend(); ++i, --new_text_length) {
23 if (*i ==
' ' || *i ==
'\t') {
26 }
else if (*i ==
'\n') {
34 text.resize(new_text_length);
38 return std::format(
"<text {}>", text);
A dynamic data type.
Definition datum.hpp:213
Definition formula_evaluation_context.hpp:16
void write(std::string_view text) noexcept
Write data to the output.
Definition formula_evaluation_context.hpp:51
Definition parse_location.hpp:17
Definition skeleton_node.hpp:16
Definition skeleton_string_node.hpp:11
void left_align() noexcept override
Remove any trailing spaces or tabs after a new-line.
Definition skeleton_string_node.hpp:19
bool should_left_align() const noexcept override
Should any spaces on the left side of a statement be removed?
Definition skeleton_string_node.hpp:17
datum evaluate(formula_evaluation_context &context) override
Evaluate the template.
Definition skeleton_string_node.hpp:41