comparison cmd2.py @ 53:2811505b0969

fixed up unified pipe and redirect works on wc
author catherine@localhost
date Mon, 09 Jun 2008 10:46:00 -0400
parents 49de899a05a8
children a791d615545c
comparison
equal deleted inserted replaced
52:49de899a05a8 53:2811505b0969
283 283
284 return stop 284 return stop
285 285
286 statementEndPattern = re.compile(r'[%s]\s*$' % terminators) 286 statementEndPattern = re.compile(r'[%s]\s*$' % terminators)
287 def statementHasEnded(self, lines): 287 def statementHasEnded(self, lines):
288 #import pdb; pdb.set_trace()
289 return bool(self.statementEndPattern.search(lines)) \ 288 return bool(self.statementEndPattern.search(lines)) \
290 or lines[-3:] == 'EOF' \ 289 or lines[-3:] == 'EOF' \
291 or self.findPipe(lines)[1] \
292 or self.parseRedirectors(lines)[1] 290 or self.parseRedirectors(lines)[1]
293 291
294 def finishStatement(self, firstline): 292 def finishStatement(self, firstline):
295 statement = firstline 293 statement = firstline
296 while not self.statementHasEnded(statement): 294 while not self.statementHasEnded(statement):