mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Ever-so-slight improvementL the patterns to recognize import
statements now also stop at ';' (formerly they only stopped at '#').
This commit is contained in:
parent
7d447aabbf
commit
e73d702344
1 changed files with 2 additions and 2 deletions
|
@ -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]*')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue