@@ -33,8 +33,20 @@ const char *getTokenTypeName(TokenType Type) {
3333 return nullptr ;
3434}
3535
36+ static constexpr std::array<StringRef, 14 > QtPropertyKeywords = {
37+ " BINDABLE" , " CONSTANT" , " DESIGNABLE" , " FINAL" , " MEMBER" ,
38+ " NOTIFY" , " READ" , " REQUIRED" , " RESET" , " REVISION" ,
39+ " SCRIPTABLE" , " STORED" , " USER" , " WRITE" ,
40+ };
41+
42+ bool FormatToken::isQtProperty () const {
43+ assert (llvm::is_sorted (QtPropertyKeywords));
44+ return std::binary_search (QtPropertyKeywords.begin (),
45+ QtPropertyKeywords.end (), TokenText);
46+ }
47+
3648// Sorted common C++ non-keyword types.
37- static SmallVector <StringRef> CppNonKeywordTypes = {
49+ static constexpr std::array <StringRef, 14 > CppNonKeywordTypes = {
3850 " clock_t" , " int16_t" , " int32_t" , " int64_t" , " int8_t" ,
3951 " intptr_t" , " ptrdiff_t" , " size_t" , " time_t" , " uint16_t" ,
4052 " uint32_t" , " uint64_t" , " uint8_t" , " uintptr_t" ,
@@ -330,6 +342,8 @@ bool startsNextParameter(const FormatToken &Current, const FormatStyle &Style) {
330342 }
331343 if (Style.Language == FormatStyle::LK_Proto && Current.is (TT_SelectorName))
332344 return true ;
345+ if (Current.is (TT_QtProperty))
346+ return true ;
333347 return Previous.is (tok::comma) && !Current.isTrailingComment () &&
334348 ((Previous.isNot (TT_CtorInitializerComma) ||
335349 Style.BreakConstructorInitializers !=
0 commit comments