[PATCH] D77311: clang-format: [JS] detect C++ keywords.

Martin Probst via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 2 08:06:31 PDT 2020


mprobst created this revision.
mprobst added a reviewer: krasimir.
Herald added subscribers: cfe-commits, jfb.
Herald added a project: clang.

C++ defines a number of keywords that are regular identifiers in
JavaScript, e.g. `concept`:

  const concept = 1; // legit JS

This change expands the existing `IsJavaScriptIdentifier(Tok)` function
to return false for C++ keywords that aren't keywords in JS.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77311

Files:
  clang/lib/Format/FormatToken.h
  clang/lib/Format/TokenAnnotator.cpp
  clang/unittests/Format/FormatTestJS.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77311.254528.patch
Type: text/x-patch
Size: 5960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200402/e5f6fd97/attachment.bin>


More information about the cfe-commits mailing list