mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-12-16 03:08:52 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6185dfee14 | ||
|
|
a74ad23514 | ||
|
|
2d9b4992ec | ||
|
|
82e8c1e68b |
@@ -618,7 +618,7 @@ add a comma after the first element (like `[1,]`).
|
|||||||
"[[table]]"_toml; // This is a table that has an array of tables inside.
|
"[[table]]"_toml; // This is a table that has an array of tables inside.
|
||||||
|
|
||||||
"[[1]]"_toml; // This literal is ambiguous.
|
"[[1]]"_toml; // This literal is ambiguous.
|
||||||
// Currently, it becomes a table taht has array of table "1".
|
// Currently, it becomes a table that has array of table "1".
|
||||||
"1 = [{}]"_toml; // This is a table that has an array of table named 1.
|
"1 = [{}]"_toml; // This is a table that has an array of table named 1.
|
||||||
"[[1,]]"_toml; // This is an array of arrays.
|
"[[1,]]"_toml; // This is an array of arrays.
|
||||||
"[[1],]"_toml; // ditto.
|
"[[1],]"_toml; // ditto.
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ inline ::toml::value operator""_toml(const char* str, std::size_t len)
|
|||||||
if(auto data = ::toml::detail::parse_toml_file(loc))
|
if(auto data = ::toml::detail::parse_toml_file(loc))
|
||||||
{
|
{
|
||||||
loc.reset(loc.begin()); // rollback to the top of the literal
|
loc.reset(loc.begin()); // rollback to the top of the literal
|
||||||
|
// skip needless characters for error message
|
||||||
|
skip_line::invoke(loc); // skip the first several needless lines
|
||||||
|
skip_ws::invoke(loc); // skip the first several needless whitespaces
|
||||||
return ::toml::value(std::move(data.unwrap()),
|
return ::toml::value(std::move(data.unwrap()),
|
||||||
::toml::detail::region<std::vector<char>>(std::move(loc)));
|
::toml::detail::region<std::vector<char>>(std::move(loc)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -343,7 +343,8 @@ inline std::string format_underline(const std::string& message,
|
|||||||
{
|
{
|
||||||
// invalid
|
// invalid
|
||||||
// ~~~~~~~
|
// ~~~~~~~
|
||||||
retval << make_string(reg->size(), '~');
|
const auto underline_len = std::min(reg->size(), reg->line().size());
|
||||||
|
retval << make_string(underline_len, '~');
|
||||||
}
|
}
|
||||||
|
|
||||||
retval << ' ';
|
retval << ' ';
|
||||||
|
|||||||
Reference in New Issue
Block a user