Mercurial > python-cmd2
diff cmd2.py @ 167:a38303571916
trying to change ignores
author | catherine@dellzilla |
---|---|
date | Mon, 08 Dec 2008 17:44:08 -0500 |
parents | a3414ac38677 |
children | 786ab5a83eea |
line wrap: on
line diff
--- a/cmd2.py Mon Dec 08 17:27:47 2008 -0500 +++ b/cmd2.py Mon Dec 08 17:44:08 2008 -0500 @@ -226,6 +226,7 @@ commentGrammars = pyparsing.Or([pyparsing.pythonStyleComment, pyparsing.cStyleComment]) commentGrammars.addParseAction(lambda x: '') commentInProgress = pyparsing.Literal('/*') + pyparsing.SkipTo(pyparsing.stringEnd) + quotedStringInProgress = pyparsing.Literal('"') ^ pyparsing.Literal("'") + pyparsing.SkipTo(pyparsing.stringEnd) terminators = [';', '\n\n'] multilineCommands = [] @@ -396,7 +397,8 @@ ) self.commentGrammars.ignore(pyparsing.sglQuotedString).ignore(pyparsing.dblQuotedString).setParseAction(lambda x: '') self.commentInProgress.ignore(pyparsing.sglQuotedString).ignore(pyparsing.dblQuotedString).ignore(pyparsing.cStyleComment) - self.parser.ignore(pyparsing.sglQuotedString).ignore(pyparsing.dblQuotedString).ignore(self.commentGrammars).ignore(self.commentInProgress) + self.quotedStringInProgress.ignore(pyparsing.sglQuotedString).ignore(pyparsing.dblQuotedString) + self.parser.ignore(pyparsing.sglQuotedString).ignore(pyparsing.dblQuotedString).ignore(self.commentGrammars).ignore(self.commentInProgress).ignore(self.quotedStringInProgress) inputMark = pyparsing.Literal('<') inputMark.setParseAction(lambda x: '')