================
@@ -19,13 +19,234 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/Debug.h"
 #include <algorithm>
+#include <iterator>
 
 #define DEBUG_TYPE "format-token-breaker"
 
 namespace clang {
 namespace format {
 
+class BreakableBlockComment;
+
 static constexpr StringRef Blanks(" \t\v\f\r");
+static constexpr size_t BlockCommentOpenerLength = 2;
+static constexpr size_t BlockCommentCloserLength = 2;
+
+namespace {
+
+bool isWellFormedBlockCommentText(StringRef Text) {
+  return Text.size() >= BlockCommentOpenerLength + BlockCommentCloserLength &&
+         Text.starts_with("/*") && Text.ends_with("*/");
+}
+
+int countTrailingSpaces(StringRef Text) {
+  const size_t TrimmedSize = Text.rtrim(Blanks).size();
+  return static_cast<int>(Text.size() - TrimmedSize);
+}
+
+FormatStyle::CommentSpaceMode
+resolveCommentSpaceMode(const FormatStyle &Style, const FormatToken &Tok,
+                        FormatStyle::CommentSpaceMode GeneralMode,
+                        FormatStyle::CommentSpaceMode ParamOverrideMode,
+                        const bool ForceDocstringLeave) {
+  if (Tok.getBlockCommentKind() == CommentKind::Parameter) {
+    if (ParamOverrideMode != FormatStyle::CommentSpaceMode::Leave)
----------------
HazardyKnusperkeks wrote:

Why?

https://github.com/llvm/llvm-project/pull/162105
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to