diff options
author | John Hodge <tpg@ucc.asn.au> | 2018-06-03 14:57:05 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2018-06-03 14:57:05 +0800 |
commit | bf8f8b4b4a9fe273451be59f68acafbe61968b83 (patch) | |
tree | 82993550cb3c88de0edbd55d79e4ea8e8cefffac /tools/common/toml.cpp | |
parent | 39b3cf53798683e496804f8322da2254b10850f4 (diff) | |
parent | a7fb27789a2b34543851d207120e2c0001ee9c27 (diff) | |
download | mrust-bf8f8b4b4a9fe273451be59f68acafbe61968b83.tar.gz |
Merge branch 'master' of https://github.com/thepowersgang/mrustc
Diffstat (limited to 'tools/common/toml.cpp')
-rw-r--r-- | tools/common/toml.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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: |