comparison cmd2.py @ 131:d94b79807da0

noSpecialParse
author catherine@dellzilla
date Fri, 07 Nov 2008 16:13:53 -0500
parents 64ad2b28d69d
children
comparison
equal deleted inserted replaced
130:64ad2b28d69d 131:d94b79807da0
240 return s 240 return s
241 result = (pyparsing.SkipTo(pyparsing.StringEnd()))('fullStatement').parseString(s) 241 result = (pyparsing.SkipTo(pyparsing.StringEnd()))('fullStatement').parseString(s)
242 command = s.split()[0] 242 command = s.split()[0]
243 if self.caseInsensitive: 243 if self.caseInsensitive:
244 command = command.lower() 244 command = command.lower()
245 '''if command in self.noSpecialParse: 245 if command in self.noSpecialParse:
246 result['statement'] = result['upToIncluding'] = result['unterminated'] = result.fullStatement
247 result['command'] = command 246 result['command'] = command
248 result['args'] = ' '.join(result.fullStatement.split()[1:]) 247 result['statement'] = result.fullStatement
249 return result''' 248 return result
250 if s[0] in self.shortcuts: 249 if s[0] in self.shortcuts:
251 s = self.shortcuts[s[0]] + ' ' + s[1:] 250 s = self.shortcuts[s[0]] + ' ' + s[1:]
252 result['statement'] = s 251 result['statement'] = s
253 result['parseable'] = s 252 result['parseable'] = s
254 result += parseSearchResults(self.terminatorPattern, s) 253 result += parseSearchResults(self.terminatorPattern, s)