diff --git a/inc/parsing.h b/inc/parsing.h index e7db6ee..879a88f 100644 --- a/inc/parsing.h +++ b/inc/parsing.h @@ -244,7 +244,7 @@ constexpr parse_result_t()>> parse_string() { return {false, i, {}}; } i = new_i; - result.result[format_node_pos] = format_node; + result.result[format_node_pos++] = format_node; } else if (s[i] == '}') { return {false, i, {}}; diff --git a/src/main.cpp b/src/main.cpp index 82af253..f7d2a11 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,7 +20,7 @@ int main() { std::cout << std::endl; - constexpr auto ast = detail::parse_string<"Test: {:16.8} {:03.5} {:08.2}">(); + 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) {