[PATCH] D75606: [clang-format] Improve identification of C# nullables

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 4 07:52:13 PST 2020


krasimir accepted this revision.
krasimir added a comment.
This revision is now accepted and ready to land.

Looks good with 1 suggestion.



================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1018
+             (Tok->Next && Tok->Next->is(tok::identifier) && Tok->Next->Next &&
+              Tok->Next->Next->isOneOf(tok::equal, tok::semi)))) {
           Tok->Type = TT_CSharpNullable;
----------------
The check for `tok::semi` here is redundant: in an example like `Type? name;`, `Line.MustBeDeclaration` is true and this is not reached.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75606





More information about the cfe-commits mailing list