diff options
author | joerg <joerg@FreeBSD.org> | 1996-10-18 17:23:33 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1996-10-18 17:23:33 +0000 |
commit | 49f79cab93eb0dbc3fec225e6a07922fbd8a767e (patch) | |
tree | 02719197ee39358e0ec5e055a8df55fc2c83928b /usr.bin/vgrind/regexp.c | |
parent | 591c888b2abec0576497dc5d0c6c987aa485c772 (diff) | |
download | FreeBSD-src-49f79cab93eb0dbc3fec225e6a07922fbd8a767e.zip FreeBSD-src-49f79cab93eb0dbc3fec225e6a07922fbd8a767e.tar.gz |
Slightly improve the C and C++ support. Allow for function return
types being on the same line as the function name, this finally closes
PR # bin/1785. Also allow :: and ~ as part of the function name, for
C++.
Still, C++ operator overloading will not be recognized as a valid
function name. Fixing this would require a major overhaul of the \p
recognition parser.
Diffstat (limited to 'usr.bin/vgrind/regexp.c')
-rw-r--r-- | usr.bin/vgrind/regexp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/vgrind/regexp.c b/usr.bin/vgrind/regexp.c index 472b6d4..d606620 100644 --- a/usr.bin/vgrind/regexp.c +++ b/usr.bin/vgrind/regexp.c @@ -458,7 +458,12 @@ expmatch (s, re, mstring) /* not optional and we still matched */ return (NIL); } - if (!isalnum(*s1) && *s1 != '_') + if (!(isalnum(*s1) || *s1 == '_' || + /* C++ destructor */ + *s1 == '~' || + /* C++ scope operator */ + (strlen(s1) > 1 && *s1 == ':' && s1[1] == ':' && + (s1++, TRUE)))) return (NIL); if (*s1 == '\\') _escaped = _escaped ? FALSE : TRUE; |