Mercurial > python-cmd2
diff cmd2.py @ 277:b3702f5ed467 0.5.5
changes for sqlpython 1.6.7
author | catherine@cordelia |
---|---|
date | Fri, 07 Aug 2009 16:38:31 -0400 |
parents | 9bcfa4f81825 |
children | c6064bfd4d6c |
line wrap: on
line diff
--- a/cmd2.py Tue Jun 02 07:34:15 2009 -0400 +++ b/cmd2.py Fri Aug 07 16:38:31 2009 -0400 @@ -335,6 +335,7 @@ commentGrammars = pyparsing.Or([pyparsing.pythonStyleComment, pyparsing.cStyleComment]) commentGrammars.addParseAction(lambda x: '') commentInProgress = pyparsing.Literal('/*') + pyparsing.SkipTo(pyparsing.stringEnd) + commentInProgress = pyparsing.NoMatch() terminators = [';'] blankLinesAllowed = False multilineCommands = [] @@ -523,9 +524,9 @@ self.multilineParser.ignore(self.commentInProgress) self.singleLineParser = ((oneLineCommand + pyparsing.SkipTo(terminatorParser ^ stringEnd ^ pipe ^ outputParser).setParseAction(lambda x:x[0].strip())('args'))('statement') + pyparsing.Optional(terminatorParser) + afterElements) - #self.multilineParser = self.multilineParser.setResultsName('multilineParser') - #self.singleLineParser = self.singleLineParser.setResultsName('singleLineParser') - #self.blankLineTerminationParser = self.blankLineTerminationParser.setResultsName('blankLineTerminatorParser') + self.multilineParser = self.multilineParser.setResultsName('multilineParser') + self.singleLineParser = self.singleLineParser.setResultsName('singleLineParser') + self.blankLineTerminationParser = self.blankLineTerminationParser.setResultsName('blankLineTerminatorParser') self.parser = self.prefixParser + ( stringEnd | self.multilineParser |