summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-01-08 00:10:39 +0100
committerAlejandro Colomar <alx@kernel.org>2023-01-08 00:10:42 +0100
commit3cc1d3885007238256e70c100eec938fd94b7ee3 (patch)
tree0578622654c36da3ba1d600be09b9faeb18cb459
parentf805aa763fad3156428866a02de95ba9b67079a7 (diff)
Support parenthesized function names
This creates some false positives, but with appropriate flags, those can be removed. Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rwxr-xr-xbin/grepc4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/grepc b/bin/grepc
index df15953..8e55e1a 100755
--- a/bin/grepc
+++ b/bin/grepc
@@ -206,7 +206,7 @@ grepc_func_proto()
grepc_helper \
"\b$1\s*\(" \
'.' \
- '(?s)^[\w[]([\w\s\(,\)[\]*]|::)+[\w\s\)*\]]\s+\**'"$1"'\s*\(([\w\s\(,\)[\]*]|::)+?(\.\.\.)?\)([\w\s\(,\)[\]]|::)*;';
+ '(?s)^[\w[]([\w\s\(,\)[\]*]|::)+[\w\s\)*\]]\s+\**\(?'"$1"'\)?\s*\(([\w\s\(,\)[\]*]|::)+?(\.\.\.)?\)([\w\s\(,\)[\]]|::)*;';
}
@@ -215,7 +215,7 @@ grepc_func_def()
grepc_helper \
"\b$1\s*\(" \
'.' \
- '(?s)^[\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**'"$1"'\s*\(([\w\s\(,\)[\]*]|::)+?(\.\.\.)?\)[ \t]*\n([ \t]*){.*?^\4}';
+ '(?s)^[\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**\(?'"$1"'\)?\s*\(([\w\s\(,\)[\]*]|::)+?(\.\.\.)?\)[ \t]*\n([ \t]*){.*?^\4}';
}