diff options
author | Guido van Rossum <guido@python.org> | 1998-10-13 16:12:36 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-10-13 16:12:36 +0000 |
commit | e73d702344ad85fa1386d77cfa4d56091e39835b (patch) | |
tree | 78030e9d6d51528eeeff37acfd3569a00147555e /Lib/pyclbr.py | |
parent | 7d447aabbf6a97f5d2a988e56fb9381cdfba32d6 (diff) | |
download | cpython-git-e73d702344ad85fa1386d77cfa4d56091e39835b.tar.gz |
Ever-so-slight improvementL the patterns to recognize import
statements now also stop at ';' (formerly they only stopped at '#').
Diffstat (limited to 'Lib/pyclbr.py')
-rw-r--r-- | Lib/pyclbr.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pyclbr.py b/Lib/pyclbr.py index 6af4692074..25fc33f44e 100644 --- a/Lib/pyclbr.py +++ b/Lib/pyclbr.py @@ -42,8 +42,8 @@ id = '[A-Za-z_][A-Za-z0-9_]*' # match identifier blank_line = re.compile('^[ \t]*($|#)') is_class = re.compile('^class[ \t]+(?P<id>'+id+')[ \t]*(?P<sup>\([^)]*\))?[ \t]*:') is_method = re.compile('^[ \t]+def[ \t]+(?P<id>'+id+')[ \t]*\(') -is_import = re.compile('^import[ \t]*(?P<imp>[^#]+)') -is_from = re.compile('^from[ \t]+(?P<module>'+id+'([ \t]*\\.[ \t]*'+id+')*)[ \t]+import[ \t]+(?P<imp>[^#]+)') +is_import = re.compile('^import[ \t]*(?P<imp>[^#;]+)') +is_from = re.compile('^from[ \t]+(?P<module>'+id+'([ \t]*\\.[ \t]*'+id+')*)[ \t]+import[ \t]+(?P<imp>[^#;]+)') dedent = re.compile('^[^ \t]') indent = re.compile('^[^ \t]*') |