https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From b0b755a562e80ef712e5c0ddaaaf6c94e2c8ef72 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From f5caba3d2b793ad0591a7bba2d26fdbd5de11f1b Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 9a5e2d67775ce1387263c4ad7c18b7dcbdc64b21 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
@@ -148,6 +160,24 @@ class AnnotatingParser {
}
}
+ const FormatStyle::FunctionDeclarationWithKeywords *
+ isInsideFunctionWithKeywordedParameters(const FormatToken &Token) const {
+const FormatToken *Previous = &Token;
+while (auto Prev = Previous->getPrevious
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 3cffb6a3c8a4bda050b56900d0333aed1cbe0216 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH 1/2] [clang-format] add option to bin-pack keyworded
parameters
https://github.com/zeule created
https://github.com/llvm/llvm-project/pull/131605
The Q_PROPERTY declaration is almost like a function declaration, but uses
keywords as parameter separators. This allows users to provide list of those
keywords to be used to control bin-packing of the macro para
@@ -148,6 +160,24 @@ class AnnotatingParser {
}
}
+ const FormatStyle::FunctionDeclarationWithKeywords *
+ isInsideFunctionWithKeywordedParameters(const FormatToken &Token) const {
+const FormatToken *Previous = &Token;
+while (auto Prev = Previous->getPrevious
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 3f9cd2caa38d1b004b723049c22f4a19283d4d05 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
@@ -148,6 +160,24 @@ class AnnotatingParser {
}
}
+ const FormatStyle::FunctionDeclarationWithKeywords *
+ isInsideFunctionWithKeywordedParameters(const FormatToken &Token) const {
+const FormatToken *Previous = &Token;
+while (auto Prev = Previous->getPrevious
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 4f0c149795c35789bfb88e5e77c9aaa799c7b592 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 833157960f14ff354f4c1b2121029353ee55de84 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 2c9a7417287aeb7931ee012914448c8c6fcae06a Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
zeule wrote:
> Please fix the spellings
I guess the simplest way would be to rename "FunctionDeclarationWithKeywords"
(e.g. "KeywordedFunctionDeclaration")? Otherwise I would have to extend the
logic in `pluralize()` inside `clang/docs/tools/dump_format_style.py`?
https://github.com/llvm/llvm
@@ -1,3 +1,4 @@
Strings
+FunctionDeclarationWithKeywordes
zeule wrote:
Running `clang/docs/tools/dump_format_style.py` generates that entry, I guess
because of
[this](https://github.com/llvm/llvm-project/blob/65ad02b882ba545dafbfc195a78e204c218e93ed/clang/docs
@@ -3783,10 +3823,20 @@ void TokenAnnotator::annotate(AnnotatedLine &Line) {
static bool isFunctionDeclarationName(const LangOptions &LangOpts,
const FormatToken &Current,
const AnnotatedLine &Line,
+
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From e2db7bd178a2c466b066787f235578b624a23644 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 7642499ca3bd2929c7392b7d619980b3cf9e648c Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 849636c372580082b8c67d7d66728788d284ebee Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From ab0165b868ffcdbf9330d0e0eab274117eb99c80 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
@@ -29102,6 +29102,65 @@ TEST_F(FormatTest, BreakBeforeClassName) {
"ArenaSafeUniquePtr {};");
}
+TEST_F(FormatTest, FunctionDeclarationWithKeywords) {
zeule wrote:
Done, thanks.
https://github.com/llvm/llvm-project/pull/131605
___
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 5a1ed72f4be5ddd426a03ce1d1fb9cefc233942a Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
@@ -3146,6 +3146,45 @@ struct FormatStyle {
/// \version 16
IntegerLiteralSeparatorStyle IntegerLiteralSeparator;
+ /// Function-like declaration with keyworded parameters.
+ /// Lists possible keywords for a named macro-like function
+ struct KeywordedFunctionLikeMacro
@@ -3146,6 +3146,45 @@ struct FormatStyle {
/// \version 16
IntegerLiteralSeparatorStyle IntegerLiteralSeparator;
+ /// Function-like declaration with keyworded parameters.
+ /// Lists possible keywords for a named macro-like function
zeule wrote:
Lists
zeule wrote:
Of course it is only because of the Qt popularity I submit this changeset to
the mainline.
The keywords are natural delimiters in those declarations, so I can't see the
proposed solution to use them as delimiters to be unsuitable to an any
significant group of Qt users. In the
@@ -148,6 +158,32 @@ class AnnotatingParser {
}
}
+ const FormatStyle::FunctionDeclarationWithKeywords *
+ findFunctionWithKeywordedParameters() const {
+const FormatToken *TokBeforeFirstLParent{};
+for (const FormatToken *T = Line.First; T != Line.Last; T = T-
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From b6d53143b5f3fd6db9f6b76df9dd49425d9038a8 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] add option to bin-pack keyworded parameters
The
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 4d687d4eabd8e0b5e31f829608d01d390e040630 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
zeule wrote:
I renamed the thing so that it ends with a singular noun, which allows the
exiting machinery in dump_format_style.py to work, and I like the new name
better.
https://github.com/llvm/llvm-project/pull/131605
___
cfe-commits mailing list
c
zeule wrote:
Thank you, @HazardyKnusperkeks !
https://github.com/llvm/llvm-project/pull/131605
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From a4b958d62f92616a00449fab04294c91e45aa531 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 0402a25b38adab644b4fdb8d7309593940702402 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
zeule wrote:
I hope it is clean now.
https://github.com/llvm/llvm-project/pull/131605
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 58eb85b45f56142f36686d2a1499deb2e7736eb6 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 352742af34d52dd265cc01ff47ca73047aa423e5 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
https://github.com/zeule updated
https://github.com/llvm/llvm-project/pull/131605
>From 7d79e05ec1a6086c85f73d087ac1667fc0246d22 Mon Sep 17 00:00:00 2001
From: Eugene Shalygin
Date: Mon, 17 Mar 2025 11:23:35 +0100
Subject: [PATCH] [clang-format] option to control bin-packing keyworded
paramete
https://github.com/zeule edited https://github.com/llvm/llvm-project/pull/131605
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -498,6 +498,8 @@ clang-format
top of the file.
- Add ``EnumTrailingComma`` option for inserting/removing commas at the end of
``enum`` enumerator lists.
+- Allow to apply parameters bin-packing options to function-like macros that
+ use keywords to delimit parameters (e
zeule wrote:
> IMO, a boolean option, e.g. `AllowBreakBeforeQPropertyKeyword` should
> suffice.
I don't like to hardcode neither the macro name nor the keywords, which depend
on Qt version. Implementation would not differ save for the source we fetch
keywords from.
https://github.com/llvm/
38 matches
Mail list logo