Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f39fbb

Browse files
committed
Adapt the regular expression to the new class syntax.
1 parent 6c6b78d commit 9f39fbb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Tools/scripts/eptags.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def main():
1818
for file in args:
1919
treat_file(file, outfp)
2020

21-
matcher = regexp.compile('^[ \t]*(def|class)[ \t]+([a-zA-Z0-9_]+)[ \t]*\(')
21+
expr = '^[ \t]*(def|class)[ \t]+([a-zA-Z0-9_]+)[ \t]*[:(]'
22+
matcher = regexp.compile(expr).match
2223

2324
def treat_file(file, outfp):
2425
try:
@@ -34,7 +35,7 @@ def treat_file(file, outfp):
3435
line = fp.readline()
3536
if not line: break
3637
lineno = lineno + 1
37-
res = matcher.exec(line)
38+
res = matcher(line)
3839
if res:
3940
(a, b), (a1, b1), (a2, b2) = res
4041
name = line[a2:b2]

0 commit comments

Comments
 (0)