view ignoreBug.py @ 260:2b69c4d72cd8

unfinished experiments with testing for regular expressions
author Catherine Devlin <catherine.devlin@gmail.com>
date Fri, 03 Apr 2009 08:01:22 -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