]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Adapt the regular expression to the new class syntax.
authorGuido van Rossum <guido@python.org>
Mon, 30 Dec 1991 23:01:28 +0000 (23:01 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 30 Dec 1991 23:01:28 +0000 (23:01 +0000)
Tools/scripts/eptags.py

index 1c682d31be4290a5e75855f2b116e6dd87755d69..db535afabaa0cc7bf64c4d49030e79b179740796 100755 (executable)
@@ -18,7 +18,8 @@ def main():
        for file in args:
                treat_file(file, outfp)
 
-matcher = regexp.compile('^[ \t]*(def|class)[ \t]+([a-zA-Z0-9_]+)[ \t]*\(')
+expr = '^[ \t]*(def|class)[ \t]+([a-zA-Z0-9_]+)[ \t]*[:(]'
+matcher = regexp.compile(expr).match
 
 def treat_file(file, outfp):
        try:
@@ -34,7 +35,7 @@ def treat_file(file, outfp):
                line = fp.readline()
                if not line: break
                lineno = lineno + 1
-               res = matcher.exec(line)
+               res = matcher(line)
                if res:
                        (a, b), (a1, b1), (a2, b2) = res
                        name = line[a2:b2]