Renamed result to value and moved testing code

This commit is contained in:
2021-11-20 23:47:15 +01:00
parent 129b16d6e0
commit 92d8f423d8
2 changed files with 58 additions and 22 deletions

View File

@@ -13,23 +13,18 @@ private:
int main() {
Uart uart;
/* Uart uart;
Logger logger(uart);
logger.log<"Test:{}">(1, 2, 3);
std::cout << std::endl;
constexpr auto ast = detail::parse_string<"Test: {:16.8f} {:03.5} {:08.2}">();
static_assert(ast.is_valid);
*/
for (const auto& format_node : ast.result) {
std::cout << "\tFormat Node:" << std::endl;
std::cout << "\t\thas_zero_padding:\t" << format_node.has_zero_padding << std::endl;
std::cout << "\t\tlength:\t\t\t\t" << format_node.length << std::endl;
std::cout << "\t\tprecision:\t\t\t" << format_node.precision << std::endl;
std::cout << "\t\ttype:\t\t\t\t" << static_cast<int>(format_node.type) << std::endl;
}
constexpr detail::ConstString s{"Test: {:16.8f} {:03.5} {:08.2}"};
const auto formatted = format<s>(3.4, "abc", 8.98754);
/*
constexpr detail::ConstString s = "{:8.14c}";