fix: skip whitespaces without newline

This commit is contained in:
ToruNiina
2019-08-26 18:16:09 +09:00
parent e332e018db
commit 7a1b5bd64e
2 changed files with 11 additions and 0 deletions

View File

@@ -45,6 +45,16 @@ BOOST_AUTO_TEST_CASE(test_file_as_literal)
b = "baz" b = "baz"
)"_toml; )"_toml;
BOOST_TEST(r == v);
}
{
const toml::value r{
{"array_of_tables", toml::array{toml::table{}}}
};
const toml::value v = u8R"(
[[array_of_tables]]
)"_toml;
BOOST_TEST(r == v); BOOST_TEST(r == v);
} }
} }

View File

@@ -1751,6 +1751,7 @@ parse_ml_table(location<Container>& loc)
using skip_line = repeat< using skip_line = repeat<
sequence<maybe<lex_ws>, maybe<lex_comment>, lex_newline>, at_least<1>>; sequence<maybe<lex_ws>, maybe<lex_comment>, lex_newline>, at_least<1>>;
skip_line::invoke(loc); skip_line::invoke(loc);
lex_ws::invoke(loc);
table_type tab; table_type tab;
while(loc.iter() != loc.end()) while(loc.iter() != loc.end())