Fix not checking for \\r\\n when parsing line comments

This commit is contained in:
Andreas Keller
2024-07-09 09:50:31 +02:00
parent 5ac47b8983
commit 143437d309

View File

@@ -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;