diff --git a/src/util/io/reader.hpp b/src/util/io/reader.hpp index 94c0d5d7..5c87b30b 100644 --- a/src/util/io/reader.hpp +++ b/src/util/io/reader.hpp @@ -77,7 +77,7 @@ class Reader { /// Reads a shared_ptr from the input stream template void handle(shared_ptr& pointer); /// Reads a map from the input stream - template void handle(map& m); + template void handle(map& m); /// Reads an IndexMap from the input stream, reads only keys that already exist in the map template void handle(IndexMap& m); /// Reads a Defaultable from the input stream @@ -176,9 +176,18 @@ void Reader::handle(shared_ptr& pointer) { handle(*pointer); } -template -void Reader::handle(map& m) { - // TODO +template +void Reader::handle(map& m) { + while (true) { + // same as enterBlock + if (just_opened) moveNext(); // on the key of the parent block, first move inside it + if (indent != expected_indent) return; // not enough indentation + just_opened = true; + expected_indent += 1; + // now read the value + handle(m[key]); + exitBlock(); + } } template