@@ -41,7 +41,8 @@ constexpr char DefaultSpecialAcronyms[] =
41
41
" RGB;"
42
42
" CMYK;"
43
43
" MIDI;"
44
- " FTP" ;
44
+ " FTP;"
45
+ " ID" ;
45
46
46
47
// / For now we will only fix 'CamelCase' property to
47
48
// / 'camelCase'. For other cases the users need to
@@ -58,13 +59,13 @@ FixItHint generateFixItHint(const ObjCPropertyDecl *Decl) {
58
59
return FixItHint ();
59
60
}
60
61
61
- std::string validPropertyNameRegex (const std::vector<std::string> &Prefixes ) {
62
- std::vector<std::string> EscapedPrefixes ;
63
- EscapedPrefixes .reserve (Prefixes .size ());
62
+ std::string validPropertyNameRegex (const std::vector<std::string> &Acronyms ) {
63
+ std::vector<std::string> EscapedAcronyms ;
64
+ EscapedAcronyms .reserve (Acronyms .size ());
64
65
// In case someone defines a custom prefix which includes a regex
65
66
// special character, escape all the prefixes.
66
- std::transform (Prefixes .begin (), Prefixes .end (),
67
- std::back_inserter (EscapedPrefixes ), [](const std::string& s) {
67
+ std::transform (Acronyms .begin (), Acronyms .end (),
68
+ std::back_inserter (EscapedAcronyms ), [](const std::string& s) {
68
69
return llvm::Regex::escape (s); });
69
70
// Allow any of these names:
70
71
// foo
@@ -73,9 +74,11 @@ std::string validPropertyNameRegex(const std::vector<std::string> &Prefixes) {
73
74
// urlString
74
75
// URL
75
76
// URLString
77
+ // bundleID
76
78
return std::string (" ::((" ) +
77
- llvm::join (EscapedPrefixes.begin (), EscapedPrefixes.end (), " |" ) +
78
- " )[A-Z]?)?[a-z]+[a-z0-9]*([A-Z][a-z0-9]+)*$" ;
79
+ llvm::join (EscapedAcronyms.begin (), EscapedAcronyms.end (), " |" ) +
80
+ " )[A-Z]?)?[a-z]+[a-z0-9]*([A-Z][a-z0-9]+)*" + " (" +
81
+ llvm::join (EscapedAcronyms.begin (), EscapedAcronyms.end (), " |" ) + " )?$" ;
79
82
}
80
83
} // namespace
81
84
0 commit comments