view ignoreBug.py @ 405:3bef4253cf1b

swallow echo of editor path
author Catherine Devlin <catherine.devlin@gmail.com>
date Sat, 06 Nov 2010 07:56:07 -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