From d77c73397b684faa55f0e95484ac89ca68bde1ad Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 20 Aug 2025 15:03:18 -0400 Subject: Added "endings" object type --- tools/util/ids_yaml_format.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tools/util/ids_yaml_format.cpp') diff --git a/tools/util/ids_yaml_format.cpp b/tools/util/ids_yaml_format.cpp index 99a8890..f72f60e 100644 --- a/tools/util/ids_yaml_format.cpp +++ b/tools/util/ids_yaml_format.cpp @@ -75,6 +75,13 @@ IdMappings ReadIdsFromYaml(const std::string& filename) { } } + if (document["endings"]) { + for (const auto& ending_it : document["endings"]) { + (*result.mutable_endings())[ending_it.first.as()] = + ending_it.second.as(); + } + } + if (document["special"]) { for (const auto& special_it : document["special"]) { (*result.mutable_special())[special_it.first.as()] = @@ -127,6 +134,11 @@ void WriteIdsAsYaml(const IdMappings& ids, const std::string& filename) { result["letters"][letter_name] = letter_id; }); + OperateOnSortedMap(ids.endings(), [&result](const std::string& ending_name, + uint64_t ending_id) { + result["endings"][ending_name] = ending_id; + }); + OperateOnSortedMap(ids.special(), [&result](const std::string& special_name, uint64_t special_id) { result["special"][special_name] = special_id; -- cgit 1.4.1