forked from OSchip/llvm-project
clang-format: [JavaScript] Ignore QT keywords.
llvm-svn: 299204
This commit is contained in:
parent
f698a69107
commit
72b3357f2d
|
@ -916,7 +916,9 @@ void UnwrappedLineParser::parseStructuralElement() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (FormatTok->isOneOf(Keywords.kw_signals, Keywords.kw_qsignals,
|
if ((Style.Language == FormatStyle::LK_Cpp ||
|
||||||
|
Style.Language == FormatStyle::LK_ObjC) &&
|
||||||
|
FormatTok->isOneOf(Keywords.kw_signals, Keywords.kw_qsignals,
|
||||||
Keywords.kw_slots, Keywords.kw_qslots)) {
|
Keywords.kw_slots, Keywords.kw_qslots)) {
|
||||||
nextToken();
|
nextToken();
|
||||||
if (FormatTok->is(tok::colon)) {
|
if (FormatTok->is(tok::colon)) {
|
||||||
|
|
|
@ -167,6 +167,8 @@ TEST_F(FormatTestJS, ReservedWordsMethods) {
|
||||||
TEST_F(FormatTestJS, CppKeywords) {
|
TEST_F(FormatTestJS, CppKeywords) {
|
||||||
// Make sure we don't mess stuff up because of C++ keywords.
|
// Make sure we don't mess stuff up because of C++ keywords.
|
||||||
verifyFormat("return operator && (aa);");
|
verifyFormat("return operator && (aa);");
|
||||||
|
// .. or QT ones.
|
||||||
|
verifyFormat("slots: Slot[];");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(FormatTestJS, ES6DestructuringAssignment) {
|
TEST_F(FormatTestJS, ES6DestructuringAssignment) {
|
||||||
|
|
Loading…
Reference in New Issue