Utilities/ModuleParser.py

changeset 3539
0c2dc1446ebf
parent 3178
f25fc1364c88
child 3591
2f2a4a76dd22
equal deleted inserted replaced
3538:33a75660df08 3539:0c2dc1446ebf
562 if thisindent > conditionalsstack[-1]: 562 if thisindent > conditionalsstack[-1]:
563 if not deltaindentcalculated: 563 if not deltaindentcalculated:
564 deltastack.append( 564 deltastack.append(
565 thisindent - conditionalsstack[-1]) 565 thisindent - conditionalsstack[-1])
566 deltaindent = reduce( 566 deltaindent = reduce(
567 lambda x, y: x + y, deltastack) 567 lambda x, y: x + y, deltastack)
568 deltaindentcalculated = 1 568 deltaindentcalculated = 1
569 thisindent -= deltaindent 569 thisindent -= deltaindent
570 else: 570 else:
571 while conditionalsstack and \ 571 while conditionalsstack and \
572 conditionalsstack[-1] >= thisindent: 572 conditionalsstack[-1] >= thisindent:
662 last_lineno_pos = start 662 last_lineno_pos = start
663 # close all classes indented at least as much 663 # close all classes indented at least as much
664 while classstack and \ 664 while classstack and \
665 classstack[-1][1] >= thisindent: 665 classstack[-1][1] >= thisindent:
666 if classstack[-1][0] is not None and \ 666 if classstack[-1][0] is not None and \
667 isinstance(classstack[-1][0], (Class, Function)): 667 isinstance(classstack[-1][0], (Class, Function)):
668 # record the end line of this class or function 668 # record the end line of this class or function
669 classstack[-1][0].setEndLine(lineno - 1) 669 classstack[-1][0].setEndLine(lineno - 1)
670 del classstack[-1] 670 del classstack[-1]
671 class_name = m.group("ClassName") 671 class_name = m.group("ClassName")
672 inherit = m.group("ClassSupers") 672 inherit = m.group("ClassSupers")

eric ide

mercurial