Parses @hide/@deprecated only in block comments
Comment annotations(or tags) should be in block comments. This is to
prevent ambiguous cases like following.
// /* @hide */
int foo;
Bug: 177616426
Test: aidl_unittests
Change-Id: Iaa6a344f6d206b643db031a007954d8e4797b1d2
diff --git a/aidl_language.cpp b/aidl_language.cpp
index e5da160..a10a19e 100644
--- a/aidl_language.cpp
+++ b/aidl_language.cpp
@@ -69,10 +69,6 @@
};
return std::find(kJavaKeywords.begin(), kJavaKeywords.end(), str) != kJavaKeywords.end();
}
-
-inline bool HasHideComment(const std::string& comment) {
- return std::regex_search(comment, std::regex("@hide\\b"));
-}
} // namespace
AidlNode::AidlNode(const AidlLocation& location) : location_(location) {}
@@ -762,7 +758,7 @@
}
bool AidlCommentable::IsHidden() const {
- return HasHideComment(GetComments());
+ return android::aidl::HasHideInComments(GetComments());
}
bool AidlCommentable::IsDeprecated() const {