mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-26 06:10:06 +00:00
fix: avoid duplicating comment: array/table elems
This commit is contained in:
parent
86e55c3bf7
commit
262f9c5fcc
@ -304,6 +304,12 @@ struct region final : public region_base
|
||||
// # this also.
|
||||
// a = value # not this.
|
||||
// ```
|
||||
|
||||
// # this is a comment for `a`, not array elements.
|
||||
// a = [1, 2, 3, 4, 5]
|
||||
if(this->first() == std::find_if(this->line_begin(), this->first(),
|
||||
[](const char c) noexcept -> bool {return c == '[' || c == '{';}))
|
||||
{
|
||||
auto iter = this->line_begin(); // points the first character
|
||||
while(iter != this->begin())
|
||||
{
|
||||
@ -338,6 +344,7 @@ struct region final : public region_base
|
||||
iter = line_start;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(com.size() > 1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user