From a7fb27789a2b34543851d207120e2c0001ee9c27 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 3 Jun 2018 14:49:07 +0800 Subject: Toml - Slightly better commenting --- tools/common/toml.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/common/toml.cpp') diff --git a/tools/common/toml.cpp b/tools/common/toml.cpp index 9fad0ec4..75a93810 100644 --- a/tools/common/toml.cpp +++ b/tools/common/toml.cpp @@ -170,9 +170,11 @@ TomlKeyValue TomlFile::get_next_value() throw ::std::runtime_error(::format("Unexpected token after key - ", t)); t = Token::lex_from(m_if); + // --- Value --- TomlKeyValue rv; switch(t.m_type) { + // String: Return the string value case Token::Type::String: rv.path = m_current_block; rv.path.insert(rv.path.end(), m_current_composite.begin(), m_current_composite.end()); @@ -180,6 +182,7 @@ TomlKeyValue TomlFile::get_next_value() rv.value = TomlValue { t.m_data }; break; + // Array: Parse the entire list and return as Type::List case Token::Type::SquareOpen: rv.path = m_current_block; rv.path.insert(rv.path.end(), m_current_composite.begin(), m_current_composite.end()); @@ -193,7 +196,8 @@ TomlKeyValue TomlFile::get_next_value() if( t.m_type == Token::Type::SquareClose ) break; - // TODO: Recurse parse a value + // TODO: Recursively parse a value + // TODO: OR, support other value types switch(t.m_type) { case Token::Type::String: -- cgit v1.2.3