[Docstring-checkins] CVS: dps/dps statemachine.py,1.11,1.12
Status: Pre-Alpha
Brought to you by:
goodger
From: David G. <go...@us...> - 2001-11-22 04:17:52
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv9514/dps/dps Modified Files: statemachine.py Log Message: - Removed trimming of blank last lines from StateMachineWS.getindented(), .getknownindented(), and .getfirstknownindented(). - Added 'atbof' and 'ateof' methods to StateMachine. Index: statemachine.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/statemachine.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** statemachine.py 2001/11/13 03:07:09 1.11 --- statemachine.py 2001/11/22 04:17:50 1.12 *************** *** 262,265 **** --- 262,273 ---- return 1 + def ateof(self): + """Return 1 if the input is at or past end-of-file.""" + return self.lineoffset >= len(self.inputlines) - 1 + + def atbof(self): + """Return 1 if the input is at or before beginning-of-file.""" + return self.lineoffset <= 0 + def previousline(self, n=1): """Load `self.line` with the `n`'th previous line and return it.""" *************** *** 743,748 **** if indented: self.nextline(len(indented) - 1) # advance to last indented line - while indented and not indented[-1].strip(): - indented.pop() while indented and not indented[0].strip(): indented.pop(0) --- 751,754 ---- *************** *** 787,792 **** if indented: self.nextline(len(indented) - 1) # advance to last indented line - while indented and not indented[-1].strip(): - indented.pop() while indented and not indented[0].strip(): indented.pop(0) --- 793,796 ---- *************** *** 818,823 **** self.inputlines[self.lineoffset + 1:], uptoblank, stripindent) self.nextline(len(indented) - 1) # advance to last indented line - while indented and not indented[-1].strip(): - indented.pop() while indented and not indented[0].strip(): indented.pop(0) --- 822,825 ---- |