Utilities/ClassBrowsers/idlclbr.py

changeset 3039
8dd0165d805d
parent 3030
4a0a82ddd9d2
child 3060
5883ce99ee12
child 3160
209a07d7e401
equal deleted inserted replaced
3038:7fe9a53280bd 3039:8dd0165d805d
81 ) 81 )
82 82
83 | (?P<End> 83 | (?P<End>
84 [ \t]* } [ \t]* ; 84 [ \t]* } [ \t]* ;
85 ) 85 )
86 """, re.VERBOSE | re.DOTALL | re.MULTILINE).search 86 """, re.VERBOSE | re.DOTALL | re.MULTILINE).search # __IGNORE_WARNING__
87 87
88 # function to replace comments 88 # function to replace comments
89 _commentsub = re.compile(r"""//[^\n]*\n|//[^\n]*$""").sub 89 _commentsub = re.compile(r"""//[^\n]*\n|//[^\n]*$""").sub
90 # function to normalize whitespace 90 # function to normalize whitespace
91 _normalize = re.compile(r"""[ \t]{2,}""").sub 91 _normalize = re.compile(r"""[ \t]{2,}""").sub
236 meth_sig = _normalize(' ', meth_sig) 236 meth_sig = _normalize(' ', meth_sig)
237 lineno = lineno + src.count('\n', last_lineno_pos, start) 237 lineno = lineno + src.count('\n', last_lineno_pos, start)
238 last_lineno_pos = start 238 last_lineno_pos = start
239 # close all interfaces/modules indented at least as much 239 # close all interfaces/modules indented at least as much
240 while classstack and \ 240 while classstack and \
241 classstack[-1][1] >= thisindent: 241 classstack[-1][1] >= thisindent:
242 if classstack[-1][0] is not None: 242 if classstack[-1][0] is not None:
243 # record the end line 243 # record the end line
244 classstack[-1][0].setEndLine(lineno - 1) 244 classstack[-1][0].setEndLine(lineno - 1)
245 del classstack[-1] 245 del classstack[-1]
246 if classstack: 246 if classstack:
285 # we found an interface definition 285 # we found an interface definition
286 thisindent = indent 286 thisindent = indent
287 indent += 1 287 indent += 1
288 # close all interfaces/modules indented at least as much 288 # close all interfaces/modules indented at least as much
289 while classstack and \ 289 while classstack and \
290 classstack[-1][1] >= thisindent: 290 classstack[-1][1] >= thisindent:
291 if classstack[-1][0] is not None: 291 if classstack[-1][0] is not None:
292 # record the end line 292 # record the end line
293 classstack[-1][0].setEndLine(lineno - 1) 293 classstack[-1][0].setEndLine(lineno - 1)
294 del classstack[-1] 294 del classstack[-1]
295 lineno = lineno + src.count('\n', last_lineno_pos, start) 295 lineno = lineno + src.count('\n', last_lineno_pos, start)
321 # we found a module definition 321 # we found a module definition
322 thisindent = indent 322 thisindent = indent
323 indent += 1 323 indent += 1
324 # close all interfaces/modules indented at least as much 324 # close all interfaces/modules indented at least as much
325 while classstack and \ 325 while classstack and \
326 classstack[-1][1] >= thisindent: 326 classstack[-1][1] >= thisindent:
327 if classstack[-1][0] is not None: 327 if classstack[-1][0] is not None:
328 # record the end line 328 # record the end line
329 classstack[-1][0].setEndLine(lineno - 1) 329 classstack[-1][0].setEndLine(lineno - 1)
330 del classstack[-1] 330 del classstack[-1]
331 lineno = lineno + src.count('\n', last_lineno_pos, start) 331 lineno = lineno + src.count('\n', last_lineno_pos, start)

eric ide

mercurial