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

sstwcw via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 15 16:24:51 PDT 2022


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 language.  Using the old
method, we had to add each keyword in the declaration, initialization,
and maybe in several lists, which turned out to be tiring and
error-prone.  Also we didn't want functions like
`IsJavaScriptIdentifier` to take linear time with respect to the number
of keywords.  In the new version we use a hash table.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121753

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121753.415625.patch
Type: text/x-patch
Size: 21070 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220315/2ac7ad07/attachment-0001.bin>


More information about the cfe-commits mailing list