comparison cmd2.py @ 183:403e1c3ffc4a

changed order for blankline parsing
author catherine@Elli.myhome.westell.com
date Fri, 16 Jan 2009 04:43:33 -0500
parents 1c21db096f49
children d1a87c14675b
comparison
equal deleted inserted replaced
182:1c21db096f49 183:403e1c3ffc4a
397 singleLineParser = ((oneLineCommand + pyparsing.SkipTo(terminatorParser ^ stringEnd ^ pipe ^ outputParser).setParseAction(lambda x:x[0].strip())('args'))('statement') + 397 singleLineParser = ((oneLineCommand + pyparsing.SkipTo(terminatorParser ^ stringEnd ^ pipe ^ outputParser).setParseAction(lambda x:x[0].strip())('args'))('statement') +
398 pyparsing.Optional(terminatorParser) + afterElements) 398 pyparsing.Optional(terminatorParser) + afterElements)
399 self.parser = ( 399 self.parser = (
400 stringEnd | 400 stringEnd |
401 multilineParser | 401 multilineParser |
402 blankLineTerminationParser |
402 multilineCommand + pyparsing.SkipTo(stringEnd) | 403 multilineCommand + pyparsing.SkipTo(stringEnd) |
403 singleLineParser | 404 singleLineParser
404 blankLineTerminationParser
405 ) 405 )
406 self.parser.ignore(pyparsing.sglQuotedString).ignore(pyparsing.dblQuotedString).ignore(self.commentGrammars).ignore(self.commentInProgress) 406 self.parser.ignore(pyparsing.sglQuotedString).ignore(pyparsing.dblQuotedString).ignore(self.commentGrammars).ignore(self.commentInProgress)
407 407
408 inputMark = pyparsing.Literal('<') 408 inputMark = pyparsing.Literal('<')
409 inputMark.setParseAction(lambda x: '') 409 inputMark.setParseAction(lambda x: '')