Mercurial > python-cmd2
view ignoreBug.py @ 288:e743cf74c518
hooray, fixed bad comment parser - all unit tests pass
author | catherine@bothari |
---|---|
date | Thu, 29 Oct 2009 13:31:41 -0400 |
parents | 2377461a35f3 |
children |
line wrap: on
line source
from pyparsing import * teststr = 'please /* ignoreme: | oops */ findme: | kthx' parser = Word(printables)('leadWord') + SkipTo('|')('statement') print parser.parseString(teststr).statement parser.ignore(cStyleComment) print parser.parseString(teststr).statement parser = Combine(parser) print parser.parseString(teststr).statement parser.ignore(cStyleComment) print parser.parseString(teststr).statement