This commit is contained in:
Costa Shulyupin 2018-07-19 12:54:54 +03:00
parent 56f15ca6c6
commit 3d2d5f5513
1 changed files with 3 additions and 4 deletions

View File

@ -76,12 +76,13 @@ def func_referers_git_grep(name):
res = set() res = set()
r = None r = None
for line in popen(r'git grep --no-index --word-regexp --show-function ' for line in popen(r'git grep --no-index --word-regexp --show-function '
r'"^\s.*\b%s"' % (name)): r'"^\s.*\b%s" '
'**.\[hc\] **.cpp **.cc **.hh' % (name)):
# Filter out names in comment afer function, # Filter out names in comment afer function,
# when comment start from ' *' # when comment start from ' *'
# To see the problem try "git grep -p and" # To see the problem try "git grep -p and"
for p in { for p in {
r'.*: \* .*%s', r'.*:\s+\* .*%s',
r'.*/\*.*%s', r'.*/\*.*%s',
r'.*//.*%s', r'.*//.*%s',
r'.*".*\b%s\b.*"'}: r'.*".*\b%s\b.*"'}:
@ -139,8 +140,6 @@ def referers_tree(name, referer=None, printed=None, level=0):
return '' return ''
listed = set() listed = set()
for a in referer(name): for a in referer(name):
if a in listed:
continue
referers_tree(a, referer, printed, level + 1) referers_tree(a, referer, printed, level + 1)
listed.add(a) listed.add(a)
return '' return ''