[PATCH] D129926: [clang-format] Handle constructor invocations after new operator in C# correct

Danil Sidoruk via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 14 05:29:03 PDT 2022


eoanermine updated this revision to Diff 452513.
eoanermine added a comment.

- Add examples to comments
- Reformat comments right


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129926/new/

https://reviews.llvm.org/D129926

Files:
  clang/lib/Format/UnwrappedLineParser.cpp


Index: clang/lib/Format/UnwrappedLineParser.cpp
===================================================================
--- clang/lib/Format/UnwrappedLineParser.cpp
+++ clang/lib/Format/UnwrappedLineParser.cpp
@@ -2861,11 +2861,11 @@
 
   if (Style.isCSharp()) {
     do {
-      // Handle constructor invocation
+      // Handle constructor invocation, e.g. `new(field: value)`.
       if (FormatTok->is(tok::l_paren))
         parseParens();
 
-      // Handle array initialization syntax
+      // Handle array initialization syntax, e.g. `new[] {10, 20, 30}`.
       if (FormatTok->is(tok::l_brace))
         parseBracedList();
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129926.452513.patch
Type: text/x-patch
Size: 630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220814/75622573/attachment.bin>


More information about the cfe-commits mailing list