comparison cmd2.py @ 88:bd0adc37f3cc

added characters to legitimate filename contents
author catherine.devlin@gmail.com
date Thu, 07 Aug 2008 13:49:30 -0400
parents 416ea36af789
children 1cd189536e90
comparison
equal deleted inserted replaced
86:2907f7c2d74c 88:bd0adc37f3cc
195 195
196 terminatorPattern = (pyparsing.Literal(';') ^ pyparsing.Literal('\n\n')) \ 196 terminatorPattern = (pyparsing.Literal(';') ^ pyparsing.Literal('\n\n')) \
197 ('terminator') 197 ('terminator')
198 argSeparatorPattern = pyparsing.Word(pyparsing.printables)('command') \ 198 argSeparatorPattern = pyparsing.Word(pyparsing.printables)('command') \
199 + pyparsing.SkipTo(pyparsing.StringEnd())('args') 199 + pyparsing.SkipTo(pyparsing.StringEnd())('args')
200 filenamePattern = pyparsing.Word(pyparsing.alphanums + '#$-_~{},.!') 200 filenamePattern = pyparsing.Word(pyparsing.alphanums + '#$-_~{},.!:\\/')
201 integerPattern = pyparsing.Word(pyparsing.nums).setParseAction( lambda s,l,t: [ int(t[0]) ] ) 201 integerPattern = pyparsing.Word(pyparsing.nums).setParseAction( lambda s,l,t: [ int(t[0]) ] )
202 pipePattern = pyparsing.Literal('|')('pipe') + pyparsing.restOfLine('pipeTo') 202 pipePattern = pyparsing.Literal('|')('pipe') + pyparsing.restOfLine('pipeTo')
203 redirectOutPattern = (pyparsing.Literal('>>') ^ '>')('output') \ 203 redirectOutPattern = (pyparsing.Literal('>>') ^ '>')('output') \
204 + pyparsing.Optional(filenamePattern)('outputTo') 204 + pyparsing.Optional(filenamePattern)('outputTo')
205 redirectInPattern = pyparsing.Literal('<')('input') \ 205 redirectInPattern = pyparsing.Literal('<')('input') \