mkmkme commented on code in PR #3128:
URL: https://github.com/apache/avro/pull/3128#discussion_r1740478375
##########
lang/c++/impl/avrogencpp.cc:
##########
@@ -739,6 +742,28 @@ void CodeGen::generateTraits(const NodePtr &n) {
}
}
+void CodeGen::generateDocComment(const NodePtr &n, const char *indent) {
+ if (!n->getDoc().empty()) {
+ std::vector<std::string> lines;
+ boost::algorithm::split(lines, n->getDoc(),
boost::algorithm::is_any_of("\n"));
+ for (auto &line : lines) {
+ boost::algorithm::replace_all(line, "\r", "");
+
+ if (line.empty()) {
+ os_ << indent << "//\n";
+ } else {
+ // If a comment line ends with a backslash, avoid generating
code which will generate
+ // multi-line comment warnings on GCC. We can't just append
whitespace here as escaped
+ // newlines ignore trailing whitespace.
+ if (line.back() == '\\') {
+ line.append("(backslash)");
Review Comment:
Am I getting it wrong or will expand
```
"with trailing backslash\\"
```
to
```
with trailing backslash \(backslash)
```
?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]