summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/memberdef.cpp12
-rw-r--r--src/regex.h8
2 files changed, 10 insertions, 10 deletions
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index 7133641..c116b7c 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -3659,16 +3659,16 @@ static QCString simplifyTypeForTable(const QCString &s)
{
QCString ts=removeAnonymousScopes(s);
if (ts.right(2)=="::") ts = ts.left(ts.length()-2);
- static const reg::Ex re1(R"(\a\w*::(\a\w*))"); // non-template version
- static const reg::Ex re2(R"(\a\w*<[^>]*>::(\a\w*))"); // template version
+ static const reg::Ex re1(R"(\a\w*::)"); // non-template version
+ static const reg::Ex re2(R"(\a\w*<[^>]*>::)"); // template version
reg::Match match;
std::string t = ts.str();
- if (reg::search(t,match,re1) || reg::search(t,match,re2))
+ while (reg::search(t,match,re2) || reg::search(t,match,re1))
{
- ts = match[1].str(); // take the identifier after the last ::
+ t = match.prefix().str() + match.suffix().str(); // remove the matched part
}
- //printf("simplifyTypeForTable(%s)->%s\n",qPrint(s),qPrint(ts));
- return ts;
+ //printf("simplifyTypeForTable(%s)->%s\n",qPrint(s),t.c_str());
+ return t;
}
QCString MemberDefImpl::fieldType() const
diff --git a/src/regex.h b/src/regex.h
index bedc052..531092b 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -162,11 +162,11 @@ class Match
/** Return a string representing the matching part. */
std::string str() const { return m_subMatches[0].str(); }
- /** Return the part of the string after the match */
- SubMatch suffix() const { SubMatch m(m_str); m.setMatch(0,position()); return m; }
-
/** Return the part of the string before the match */
- SubMatch prefix() const
+ SubMatch prefix() const { SubMatch m(m_str); m.setMatch(0,position()); return m; }
+
+ /** Return the part of the string after the match */
+ SubMatch suffix() const
{
SubMatch m(m_str);
if (m_str)