Skip to content

Commit

Permalink
- Add "AV" as new default acronym. - Add support for "I" and "A" in l…
Browse files Browse the repository at this point in the history
…owerCamelCase pattern

Summary: Now we can support property names like "hasADog" correctly.

Reviewers: benhamilton, hokein

Reviewed By: benhamilton

Subscribers: cfe-commits

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

llvm-svn: 334448
  • Loading branch information
ynzhang0509 committed Jun 11, 2018
1 parent a0c0857 commit 72cecf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Expand Up @@ -45,6 +45,7 @@ constexpr llvm::StringLiteral DefaultSpecialAcronyms[] = {
"AR",
"ARGB",
"ASCII",
"AV",
"BGRA",
"CA",
"CF",
Expand Down Expand Up @@ -153,7 +154,7 @@ std::string validPropertyNameRegex(llvm::ArrayRef<std::string> EscapedAcronyms,
std::string StartMatcher = UsedInMatcher ? "::" : "^";
std::string AcronymsMatcher = AcronymsGroupRegex(EscapedAcronyms);
return StartMatcher + "(" + AcronymsMatcher + "[A-Z]?)?[a-z]+[a-z0-9]*(" +
AcronymsMatcher + "|([A-Z][a-z0-9]+))*$";
AcronymsMatcher + "|([A-Z][a-z0-9]+)|A|I)*$";
}

bool hasCategoryPropertyPrefix(llvm::StringRef PropertyName) {
Expand Down
Expand Up @@ -22,6 +22,7 @@ @interface Foo
@property(assign, nonatomic) int shouldUseCFPreferences;
@property(assign, nonatomic) int enableGLAcceleration;
@property(assign, nonatomic) int ID;
@property(assign, nonatomic) int hasADog;
@end

@interface Foo (Bar)
Expand Down

0 comments on commit 72cecf9

Please sign in to comment.