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
MyDeveloperDay requested changes to this revision.
MyDeveloperDay added inline comments.
This revision now requires changes to proceed.
Comment at: clang/lib/Format/FormatToken.h:884
struct AdditionalKeywords {
+#define LIST_ADDITIONAL_KEYWORDS
HazardyKnusperkeks added inline comments.
Comment at: clang/lib/Format/FormatToken.h:992-999
+ enum {
+ATTR_JS_KEYWORD = 0x1,
+ATTR_CSHARP_KEYWORD = 0x2,
+ };
+ unsigned getAttrs(const FormatToken &Tok) const {
+auto At = KeywordAttr.find(Tok.Tok.getIdentifierInfo(
sstwcw marked 5 inline comments as done.
sstwcw added inline comments.
Comment at: clang/lib/Format/FormatToken.h:947
+ /* C# */
\
+ KEYWORD(dollar, 0)
sstwcw updated this revision to Diff 416051.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121753/new/
https://reviews.llvm.org/D121753
Files:
clang/lib/Format/FormatToken.h
clang/lib/Format/UnwrappedLineFormatter.cpp
clang/lib/Format/Unwrappe
HazardyKnusperkeks added inline comments.
Comment at: clang/lib/Format/FormatToken.h:907
+ KEYWORD(infer, 0)
\
+ KEYWORD(is, ATTR_JS_KEYWORD | ATTR_CSHARP_KEYWORD | ATTR_CSHARP_KEYWORD)
\
+ KEYWORD(let, ATTR_JS_K
sstwcw created this revision.
sstwcw added a reviewer: clang-format.
sstwcw added a project: clang-format.
Herald added a project: All.
sstwcw requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
We had to add a bunch of keywords for a new langu