12 |
# |
# |
13 |
# Changelog: |
# Changelog: |
14 |
# $Log$ |
# $Log$ |
15 |
|
# Revision 1.3 2002/11/12 20:14:48 jonen |
16 |
|
# + php functions maybe prefixed by a '&'. fixed sigpart regex. |
17 |
|
# + forgot 'class' (php) after all. fixed regex. |
18 |
|
# + renamed regex_perl to regex_noparenthesis |
19 |
|
# + perl subs with an space after the first '{' weren't regognized. fixed regex. |
20 |
|
# |
21 |
# Revision 1.2 2002/11/08 02:37:25 jonen |
# Revision 1.2 2002/11/08 02:37:25 jonen |
22 |
# + added cvs header |
# + added cvs header |
23 |
# + added hook for refresh on "save-file" |
# + added hook for refresh on "save-file" |
49 |
# class/function/sub/packages signatures |
# class/function/sub/packages signatures |
50 |
# in source code |
# in source code |
51 |
prefix_pattern = '^[|\s]*' |
prefix_pattern = '^[|\s]*' |
52 |
sigpart = '\s+([\w|:]+?)\s*' |
sigpart = '\s+([\w|:|&]+?)\s*' |
53 |
regex_universal=re.compile(prefix_pattern + '(?:\w+?)\*??' + sigpart + '\(.*?\)[\s|:|{]*$') |
regex_universal=re.compile(prefix_pattern + '(?:\w+?)\*??' + sigpart + '\(.*?\)[\s|:|{]*\s*$') |
54 |
regex_perl=re.compile(prefix_pattern + '(?:package|sub)' + sigpart + '[;|{]$') |
regex_noparenthesis=re.compile(prefix_pattern + '(?:package|sub|class)' + sigpart + '[;|{]\s*$') |
55 |
|
|
56 |
def get_functionNameFromLine(str): |
def get_functionNameFromLine(str): |
57 |
for regex in (regex_universal, regex_perl): |
for regex in (regex_universal, regex_noparenthesis): |
58 |
match=regex.search(str) |
match=regex.search(str) |
59 |
if match: |
if match: |
60 |
str = match.group(1) |
str = match.group(1) |