From d7c082bbd1a991bc155a1a76fea52fc0dcb3abb3 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 16 Nov 2019 17:03:10 +0800 Subject: TOML Parser - Handle newlines before close of an array --- tools/common/toml.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/common/toml.cpp') diff --git a/tools/common/toml.cpp b/tools/common/toml.cpp index 4e8e6da6..f6ce7a89 100644 --- a/tools/common/toml.cpp +++ b/tools/common/toml.cpp @@ -216,6 +216,10 @@ TomlKeyValue TomlFile::get_next_value() if(t.m_type != Token::Type::Comma) break; } + while( t.m_type == Token::Type::Newline ) + { + t = m_lexer.get_token(); + } if(t.m_type != Token::Type::SquareClose) throw ::std::runtime_error(::format(m_lexer, ": Unexpected token after array - ", t)); break; -- cgit v1.2.3