mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
Merge pull request #253 from andreaskeller96/fix/correctly-resolve-carriage-return
Fix not checking for \r\n when parsing line comments
This commit is contained in:
@@ -1855,7 +1855,14 @@ skip_multiline_spacer(location& loc, context<TC>& ctx, const bool newline_found
|
|||||||
{
|
{
|
||||||
spacer.newline_found = true;
|
spacer.newline_found = true;
|
||||||
auto comment = comm.as_string();
|
auto comment = comm.as_string();
|
||||||
if( ! comment.empty() && comment.back() == '\n') {comment.pop_back();}
|
if( ! comment.empty() && comment.back() == '\n')
|
||||||
|
{
|
||||||
|
comment.pop_back();
|
||||||
|
if (!comment.empty() && comment.back() == '\r')
|
||||||
|
{
|
||||||
|
comment.pop_back();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
spacer.comments.push_back(std::move(comment));
|
spacer.comments.push_back(std::move(comment));
|
||||||
spacer.indent_type = indent_char::none;
|
spacer.indent_type = indent_char::none;
|
||||||
|
Reference in New Issue
Block a user