https://github.com/kadircet closed
https://github.com/llvm/llvm-project/pull/76795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/76795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5151,6 +5151,14 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine
,
return true;
if (Left.IsUnterminatedLiteral)
return true;
+ // FIXME: Breaking after newlines seems useful in general. Turn this into an
+ // option and recognize more cases like
@@ -2499,6 +2499,15 @@ TEST_F(TokenAnnotatorTest, BraceKind) {
EXPECT_BRACE_KIND(Tokens[6], BK_Block);
}
+TEST_F(TokenAnnotatorTest, StreamOperator) {
+ auto Tokens = annotate("\"foo\\n\" << aux << \"foo\\n\" << \"foo\";");
+ ASSERT_EQ(Tokens.size(), 9u) << Tokens;
+
@@ -2499,6 +2499,15 @@ TEST_F(TokenAnnotatorTest, BraceKind) {
EXPECT_BRACE_KIND(Tokens[6], BK_Block);
}
+TEST_F(TokenAnnotatorTest, StreamOperator) {
+ auto Tokens = annotate("\"foo\\n\" << aux << \"foo\\n\" << \"foo\";");
+ ASSERT_EQ(Tokens.size(), 9u) << Tokens;
+
@@ -2499,6 +2499,15 @@ TEST_F(TokenAnnotatorTest, BraceKind) {
EXPECT_BRACE_KIND(Tokens[6], BK_Block);
}
+TEST_F(TokenAnnotatorTest, StreamOperator) {
+ auto Tokens = annotate("\"foo\\n\" << aux << \"foo\\n\" << \"foo\";");
+ ASSERT_EQ(Tokens.size(), 9u) << Tokens;
+
@@ -5151,6 +5151,14 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine
,
return true;
if (Left.IsUnterminatedLiteral)
return true;
+ // FIXME: Breaking after newlines seems useful in general. Turn this into an
+ // option and recognize more cases like
@@ -2499,6 +2499,15 @@ TEST_F(TokenAnnotatorTest, BraceKind) {
EXPECT_BRACE_KIND(Tokens[6], BK_Block);
}
+TEST_F(TokenAnnotatorTest, StreamOperator) {
+ auto Tokens = annotate("\"foo\\n\" << aux << \"foo\\n\" << \"foo\";");
+ ASSERT_EQ(Tokens.size(), 9u) << Tokens;
+
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/76795
From 18ef1d8901835f5129f775d292425b808f42fe85 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Wed, 3 Jan 2024 09:28:35 +0100
Subject: [PATCH 1/4] [clang-format] Break after string literals with trailing
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/76795
From 18ef1d8901835f5129f775d292425b808f42fe85 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Wed, 3 Jan 2024 09:28:35 +0100
Subject: [PATCH 1/4] [clang-format] Break after string literals with trailing
@@ -2499,6 +2499,15 @@ TEST_F(TokenAnnotatorTest, BraceKind) {
EXPECT_BRACE_KIND(Tokens[6], BK_Block);
}
+TEST_F(TokenAnnotatorTest, StreamOperator) {
+ auto Tokens = annotate("\"foo\\n\" << aux << \"foo\\n\" << \"foo\";");
+ ASSERT_EQ(Tokens.size(), 9u) << Tokens;
+
@@ -5151,6 +5151,14 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine
,
return true;
if (Left.IsUnterminatedLiteral)
return true;
+ // FIXME: Breaking after newlines seems useful in general. Turn this into an
+ // option and Recognize more cases like
kadircet wrote:
ping @HazardyKnusperkeks @owenca this is blocking releases on our side,
anything concerning here?
https://github.com/llvm/llvm-project/pull/76795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/76795
From 18ef1d8901835f5129f775d292425b808f42fe85 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Wed, 3 Jan 2024 09:28:35 +0100
Subject: [PATCH 1/3] [clang-format] Break after string literals with trailing
@@ -5151,6 +5151,14 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine
,
return true;
if (Left.IsUnterminatedLiteral)
return true;
+ if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) &&
+ // FIXME: Breaking after newlines seems
kadircet wrote:
> Can you also add a formatting test?
done
https://github.com/llvm/llvm-project/pull/76795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/76795
From 18ef1d8901835f5129f775d292425b808f42fe85 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Wed, 3 Jan 2024 09:28:35 +0100
Subject: [PATCH 1/2] [clang-format] Break after string literals with trailing
@@ -10,6 +10,7 @@
#include "FormatTestUtils.h"
#include "TestLexer.h"
+#include "clang/Basic/TokenKinds.h"
HazardyKnusperkeks wrote:
Why do you need this?
https://github.com/llvm/llvm-project/pull/76795
___
https://github.com/HazardyKnusperkeks commented:
Can you also add a formatting test?
https://github.com/llvm/llvm-project/pull/76795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/76795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
s1Sharp wrote:
It seems your changes remain compatible with the old clang-format behavior.
Сode looks quite correct
https://github.com/llvm/llvm-project/pull/76795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
llvmbot wrote:
@llvm/pr-subscribers-clang-format
Author: kadir çetinkaya (kadircet)
Changes
This restores a subset of functionality that was forego in
d68826dfbd987377ef6771d40c1d984f09ee3b9e.
Streaming multiple string literals is rare enough in practice, hence
that change makes sense in
https://github.com/kadircet created
https://github.com/llvm/llvm-project/pull/76795
This restores a subset of functionality that was forego in
d68826dfbd987377ef6771d40c1d984f09ee3b9e.
Streaming multiple string literals is rare enough in practice, hence
that change makes sense in general. But
23 matches
Mail list logo