/[navidoc]/navidoc/navidoc/util/parser.py
ViewVC logotype

Diff of /navidoc/navidoc/util/parser.py

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

revision 1.2 by humppake, Wed Jun 11 07:49:34 2003 UTC revision 1.3 by humppake, Fri Jun 27 13:17:00 2003 UTC
# Line 35  def match_remove(p, s): Line 35  def match_remove(p, s):
35      """      """
36      match_remove(p, s)      match_remove(p, s)
37    
38      Match pattern p in s and remove the match, return (match, ns).      Match pattern p in s and remove the match, return match and the
39        rest of the string.).
40      """      """
41      m = re.match(p,s)      m = re.match(p,s)
42      if m: s = re.sub(p, "", s)      if m: s = re.sub(p, "", s)
# Line 51  def tabs_to_spaces(s): Line 52  def tabs_to_spaces(s):
52    
53  def init_spaces(s, tokenize=0):  def init_spaces(s, tokenize=0):
54      """      """
55      init_spaces(s)      init_spaces(s, tokenize=0)
56    
57      Strip whitespaces and calculates the amount of them in the      Strip whitespaces and calculates the amount of them in the
58      beginning of the string. Return the amount and stripped      beginning of the string. Return the amount and stripped
# Line 75  def random_var(): Line 76  def random_var():
76    
77  def parse_indented(s, tokenize=1):  def parse_indented(s, tokenize=1):
78      """      """
79      parse_indented(s, tokenize=true)      parse_indented(s, tokenize=1)
80    
81      Split the string into lines after "\n"s. Parse the string      Split the string into lines after "\n"s. Parse the string
82      array into array tree after indentions in consecutive strings.      array into array tree after indentions in consecutive strings.
# Line 105  def keys_for_classes(module, top_class): Line 106  def keys_for_classes(module, top_class):
106      """      """
107      keys_for_classes(module, top_class)      keys_for_classes(module, top_class)
108            
109      Gather a key -> class dictionary for all classes containing      Gather a key -> class dictionary for all subclasses of top_class
110      'key' in the given module. In Navidoc this is used to      containing 'key' in the given module. In Navidoc this is used to
111      collect UML elements from modules.      collect UML elements from modules.
112      """      """
113      d = {}      d = {}

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

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26