sstwcw added a comment.

Allow me another attempt in justifying this patch.

Using the macros, it is easier to see when a keyword is not classified as some 
language's keyword.  The author and reviewers didn't notice `final` and 
`dollar` being in only one place previously.  With the old way, when someone 
adds a new keyword he is also more likely to forget to include it in the sets.

In the commit message when I said the old way turned out to be error-prone, I 
did debug why some code doesn't get formatted right only to find I forgot to 
add a keyword in one of the places.

With the `isIdentifier` and `isKeyword` functions matching the sets separately, 
it is more likely one of them will get it wrong.  In the original 
`isCSharpKeyword` function, the check is wrong, it should be `!=`.

  CSharpExtraKeywords.find(Tok.Tok.getIdentifierInfo()) == 
CSharpExtraKeywords.end()


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121753

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to