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

2020-04-03 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. mprobst marked an inline comment as done. Closed by commit rG146d685cd657: clang-format: [JS] detect C++ keywords. (authored by mprobst). Changed prior to commit: https://reviews.llvm.org/D77311?vs=254741=254763#toc

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

2020-04-03 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked 2 inline comments as done. mprobst added inline comments. Comment at: clang/lib/Format/FormatToken.h:913 bool IsJavaScriptIdentifier(const FormatToken ) const { -return Tok.is(tok::identifier) && - JsExtraKeywords.find(Tok.Tok.getIdentifierInfo())

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

2020-04-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/lib/Format/FormatToken.h:913 bool IsJavaScriptIdentifier(const FormatToken ) const { -return Tok.is(tok::identifier) && - JsExtraKeywords.find(Tok.Tok.getIdentifierInfo()) == -

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

2020-04-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77311/new/ https://reviews.llvm.org/D77311

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

2020-04-03 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision. MyDeveloperDay added a comment. I think this LGTM and brings more clarity as its much easier to look for things in the positive than the negative Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77311/new/

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

2020-04-03 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 254740. mprobst added a comment. - - improve handling of keywors - rather than blacklisting all C++ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77311/new/ https://reviews.llvm.org/D77311 Files:

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

2020-04-03 Thread Martin Probst via Phabricator via cfe-commits
mprobst added a comment. Thanks for the feedback. Indeed, whitelisting the JS keywords is better, but we still needed a way to blacklist all C++ keywords then - Krasimir's suggestion with the #include did the trick, thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-04-03 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 254741. mprobst added a comment. - fix formatting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77311/new/ https://reviews.llvm.org/D77311 Files: clang/lib/Format/FormatToken.h

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

2020-04-02 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. In D77311#1957367 , @jfb wrote: > Some of these are technically "future reserved keywords": > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords > > Wouldn't it be better to list all of

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

2020-04-02 Thread JF Bastien via Phabricator via cfe-commits
jfb added a comment. Some of these are technically "future reserved keywords": https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords Wouldn't it be better to list all of JS's keywords at this point? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

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

2020-04-02 Thread Martin Probst via Phabricator via cfe-commits
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