view ignoreBug.py @ 227:82b6e0881b78

abbrevs - but stumbling when an abbrev is predefined
author catherine@Elli.myhome.westell.com
date Mon, 23 Mar 2009 05:54:43 -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