view ignoreBug.py @ 407:f5aa16a22b52

was detecting first absent editor, not first presnt
author Catherine Devlin <catherine.devlin@gmail.com>
date Sun, 07 Nov 2010 09:24:11 -0500
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