eric6/Utilities/ClassBrowsers/rbclbr.py

changeset 8217
385f60c94548
parent 8205
4a0f1f896341
child 8228
772103b14c18
equal deleted inserted replaced
8216:6a042a54e0f7 8217:385f60c94548
328 m.group("MethodName3") 328 m.group("MethodName3")
329 ) 329 )
330 meth_sig = m.group("MethodSignature") 330 meth_sig = m.group("MethodSignature")
331 meth_sig = meth_sig and meth_sig.replace('\\\n', '') or '' 331 meth_sig = meth_sig and meth_sig.replace('\\\n', '') or ''
332 meth_sig = _commentsub('', meth_sig) 332 meth_sig = _commentsub('', meth_sig)
333 lineno = lineno + src.count('\n', last_lineno_pos, start) 333 lineno += src.count('\n', last_lineno_pos, start)
334 last_lineno_pos = start 334 last_lineno_pos = start
335 if meth_name.startswith('self.'): 335 if meth_name.startswith('self.'):
336 meth_name = meth_name[5:] 336 meth_name = meth_name[5:]
337 elif meth_name.startswith('self::'): 337 elif meth_name.startswith('self::'):
338 meth_name = meth_name[6:] 338 meth_name = meth_name[6:]
395 395
396 elif m.start("Class") >= 0: 396 elif m.start("Class") >= 0:
397 # we found a class definition 397 # we found a class definition
398 thisindent = indent 398 thisindent = indent
399 indent += 1 399 indent += 1
400 lineno = lineno + src.count('\n', last_lineno_pos, start) 400 lineno += src.count('\n', last_lineno_pos, start)
401 last_lineno_pos = start 401 last_lineno_pos = start
402 # close all classes/modules indented at least as much 402 # close all classes/modules indented at least as much
403 while classstack and classstack[-1][1] >= thisindent: 403 while classstack and classstack[-1][1] >= thisindent:
404 if classstack[-1][0] is not None: 404 if classstack[-1][0] is not None:
405 # record the end line 405 # record the end line
440 440
441 elif m.start("Module") >= 0: 441 elif m.start("Module") >= 0:
442 # we found a module definition 442 # we found a module definition
443 thisindent = indent 443 thisindent = indent
444 indent += 1 444 indent += 1
445 lineno = lineno + src.count('\n', last_lineno_pos, start) 445 lineno += src.count('\n', last_lineno_pos, start)
446 last_lineno_pos = start 446 last_lineno_pos = start
447 # close all classes/modules indented at least as much 447 # close all classes/modules indented at least as much
448 while classstack and classstack[-1][1] >= thisindent: 448 while classstack and classstack[-1][1] >= thisindent:
449 if classstack[-1][0] is not None: 449 if classstack[-1][0] is not None:
450 # record the end line 450 # record the end line
519 break 519 break
520 else: 520 else:
521 index -= 1 521 index -= 1
522 522
523 elif m.start("Attribute") >= 0: 523 elif m.start("Attribute") >= 0:
524 lineno = lineno + src.count('\n', last_lineno_pos, start) 524 lineno += src.count('\n', last_lineno_pos, start)
525 last_lineno_pos = start 525 last_lineno_pos = start
526 index = -1 526 index = -1
527 while index >= -len(classstack): 527 while index >= -len(classstack):
528 if ( 528 if (
529 classstack[index][0] is not None and 529 classstack[index][0] is not None and
539 if lastGlobalEntry: 539 if lastGlobalEntry:
540 lastGlobalEntry.setEndLine(lineno - 1) 540 lastGlobalEntry.setEndLine(lineno - 1)
541 lastGlobalEntry = None 541 lastGlobalEntry = None
542 542
543 elif m.start("Attr") >= 0: 543 elif m.start("Attr") >= 0:
544 lineno = lineno + src.count('\n', last_lineno_pos, start) 544 lineno += src.count('\n', last_lineno_pos, start)
545 last_lineno_pos = start 545 last_lineno_pos = start
546 index = -1 546 index = -1
547 while index >= -len(classstack): 547 while index >= -len(classstack):
548 if ( 548 if (
549 classstack[index][0] is not None and 549 classstack[index][0] is not None and
606 pass 606 pass
607 607
608 elif m.start("CodingLine") >= 0: 608 elif m.start("CodingLine") >= 0:
609 # a coding statement 609 # a coding statement
610 coding = m.group("Coding") 610 coding = m.group("Coding")
611 lineno = lineno + src.count('\n', last_lineno_pos, start) 611 lineno += src.count('\n', last_lineno_pos, start)
612 last_lineno_pos = start 612 last_lineno_pos = start
613 if "@@Coding@@" not in dictionary: 613 if "@@Coding@@" not in dictionary:
614 dictionary["@@Coding@@"] = ClbrBaseClasses.Coding( 614 dictionary["@@Coding@@"] = ClbrBaseClasses.Coding(
615 module, file, lineno, coding) 615 module, file, lineno, coding)
616 616

eric ide

mercurial