[PATCH] D121753: [clang-format] Use a macro for non-C keywords

2022-03-21 Thread sstwcw via Phabricator via cfe-commits
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

[PATCH] D121753: [clang-format] Use a macro for non-C keywords

2022-03-18 Thread MyDeveloperDay via Phabricator via cfe-commits
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

[PATCH] D121753: [clang-format] Use a macro for non-C keywords

2022-03-17 Thread Björn Schäpers via Phabricator via cfe-commits
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(

[PATCH] D121753: [clang-format] Use a macro for non-C keywords

2022-03-16 Thread sstwcw via Phabricator via cfe-commits
sstwcw marked 5 inline comments as done. sstwcw added inline comments. Comment at: clang/lib/Format/FormatToken.h:947 + /* C# */ \ + KEYWORD(dollar, 0)

[PATCH] D121753: [clang-format] Use a macro for non-C keywords

2022-03-16 Thread sstwcw via Phabricator via cfe-commits
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

[PATCH] D121753: [clang-format] Use a macro for non-C keywords

2022-03-16 Thread Björn Schäpers via Phabricator via cfe-commits
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

[PATCH] D121753: [clang-format] Use a macro for non-C keywords

2022-03-15 Thread sstwcw via Phabricator via cfe-commits
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