[Docstring-checkins] CVS: dps/dps statemachine.py,1.6,1.7
Status: Pre-Alpha
Brought to you by:
goodger
From: David G. <go...@us...> - 2001-08-25 03:55:17
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv28057/dps/dps Modified Files: statemachine.py Log Message: - Fixed a bug in StateMachineWS.getknownindented(), for blank first lines. - Added trimming of blank first lines to StateMachineWS.getfirstknownindented(). Index: statemachine.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/statemachine.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** statemachine.py 2001/08/25 01:47:48 1.6 --- statemachine.py 2001/08/25 03:55:14 1.7 *************** *** 726,736 **** """ offset = self.abslineoffset() ! if self.line[indent:]: ! indented = [self.line[indent:]] ! else: ! indented = [] for line in self.inputlines[self.lineoffset + 1:]: if line[:indent].strip(): ! blankfinish = len(indented) and not indented[-1].strip() break indented.append(line[indent:]) --- 726,733 ---- """ offset = self.abslineoffset() ! indented = [self.line[indent:]] for line in self.inputlines[self.lineoffset + 1:]: if line[:indent].strip(): ! blankfinish = not indented[-1].strip() and len(indented) > 1 break indented.append(line[indent:]) *************** *** 741,744 **** --- 738,744 ---- while indented and not indented[-1].strip(): indented.pop() + while indented and not indented[0].strip(): + indented.pop(0) + offset += 1 return indented, offset, blankfinish *************** *** 764,767 **** --- 764,770 ---- while indented and not indented[-1].strip(): indented.pop() + while indented and not indented[0].strip(): + indented.pop(0) + offset += 1 return indented, indent, offset, blankfinish |