[PATCH] D77311: clang-format: [JS] detect C++ keywords.
Krasimir Georgiev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 3 04:48:23 PDT 2020
krasimir added inline comments.
================
Comment at: clang/lib/Format/FormatToken.h:913
bool IsJavaScriptIdentifier(const FormatToken &Tok) const {
- return Tok.is(tok::identifier) &&
- JsExtraKeywords.find(Tok.Tok.getIdentifierInfo()) ==
- JsExtraKeywords.end();
+ switch (Tok.Tok.getKind()) {
+ case tok::kw_break:
----------------
nit: may be worth adding a comment linking to:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77311/new/
https://reviews.llvm.org/D77311
More information about the cfe-commits
mailing list