/[cvs]/nfo/patches/glimmer/scripts/FunctionSelector.py
ViewVC logotype

Diff of /nfo/patches/glimmer/scripts/FunctionSelector.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by jonen, Fri Nov 8 02:37:25 2002 UTC revision 1.3 by jonen, Tue Nov 12 20:14:48 2002 UTC
# Line 12  Line 12 
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"
# Line 43  row_number = [] Line 49  row_number = []
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)

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed