]> granicus.if.org Git - clang/commit
clang-format: [JS] fix non-null assertion operator recognition.
authorMartin Probst <martin@probst.io>
Mon, 15 May 2017 08:15:53 +0000 (08:15 +0000)
committerMartin Probst <martin@probst.io>
Mon, 15 May 2017 08:15:53 +0000 (08:15 +0000)
commitf7d8230b8d24ef0309c92ef3665742085b41a66a
treef8ff60b1a991bf54c7bf90e9f9c666b65eef9005
parentffd03c81d3b17bd25a9f3c6b22fc1b650f65a505
clang-format: [JS] fix non-null assertion operator recognition.

Summary:
`getIdentifierInfo()` includes all keywords, whereas non-null assertion
operators should only be recognized after non-keywords or pseudo keywords.
Ideally this should list all tokens that clang-format recognizes as a keyword,
but that are pseudo or no keywords in JS. For the time being, just recognize
the specific bits users ran into (`namespace` in this case).

Reviewers: djasper

Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D33182

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303038 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp