[PATCH] D42464: add prefix with '_' support for property name. Corresponding apple dev doc: https://developer.apple.com/library/content/qa/qa1908/_index.html

Yan Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 24 15:35:59 PST 2018


Wizard marked 7 inline comments as done.
Wizard added inline comments.


================
Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:120
+  auto RegexExp = llvm::Regex(
+      llvm::StringRef(validPropertyNameRegex(Acronyms).replace(0, 2, "^")));
+  return RegexExp.match(llvm::StringRef(PropertyName.substr(Start + 1)));
----------------
Wizard wrote:
> benhamilton wrote:
> > I don't understand what this is doing. Why are we replacing things in a regex?
> > 
> > I don't think this is very maintainable. Can you rewrite it for legibility, please?
> It is a little awkward here because in the matcher, the regex use "::" to indicate matching start, but in llvm::regex it is the conventional "^". I will add some comments here.
End up using a bool since it is not about naming style but whether we are using it in matcher or normal regex match.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42464





More information about the cfe-commits mailing list