@@ -33,8 +33,20 @@ const char *getTokenTypeName(TokenType Type) {
33
33
return nullptr ;
34
34
}
35
35
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
+
36
48
// Sorted common C++ non-keyword types.
37
- static SmallVector <StringRef> CppNonKeywordTypes = {
49
+ static constexpr std::array <StringRef, 14 > CppNonKeywordTypes = {
38
50
" clock_t" , " int16_t" , " int32_t" , " int64_t" , " int8_t" ,
39
51
" intptr_t" , " ptrdiff_t" , " size_t" , " time_t" , " uint16_t" ,
40
52
" uint32_t" , " uint64_t" , " uint8_t" , " uintptr_t" ,
@@ -330,6 +342,8 @@ bool startsNextParameter(const FormatToken &Current, const FormatStyle &Style) {
330
342
}
331
343
if (Style.Language == FormatStyle::LK_Proto && Current.is (TT_SelectorName))
332
344
return true ;
345
+ if (Current.is (TT_QtProperty))
346
+ return true ;
333
347
return Previous.is (tok::comma) && !Current.isTrailingComment () &&
334
348
((Previous.isNot (TT_CtorInitializerComma) ||
335
349
Style.BreakConstructorInitializers !=
0 commit comments