view ignoreBug.py @ 262:e81378f82c7c 0.5.2

transcript tests with regex now work smoothly
author Catherine Devlin <catherine.devlin@gmail.com>
date Fri, 03 Apr 2009 13:02:36 -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