[PATCH] D76367: [clang-format] Handle C# generic type constraints

Jonathan B Coe via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 18 08:42:10 PDT 2020


jbcoe created this revision.
jbcoe added a reviewer: krasimir.
jbcoe added a project: clang-format.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Treat each C# generic type constraint, `where T: ...`, as a line.

      

Add C# keyword: where

      

Add Token Types: CSharpGenericTypeConstraint, CSharpGenericTypeConstraintColon, CSharpGenericTypeConstraintComma.

This patch does not wrap generic type constraints well, that will be addressed in a follow up patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76367

Files:
  clang/lib/Format/FormatToken.h
  clang/lib/Format/TokenAnnotator.cpp
  clang/lib/Format/UnwrappedLineFormatter.cpp
  clang/lib/Format/UnwrappedLineParser.cpp
  clang/lib/Format/UnwrappedLineParser.h
  clang/unittests/Format/FormatTestCSharp.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76367.251092.patch
Type: text/x-patch
Size: 7660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200318/b3a88ed7/attachment-0001.bin>


More information about the cfe-commits mailing list