Mercurial > python-cmd2
annotate ignoreBug.py @ 436:c4c35f002aef 0.6.4
to version 0.6.4
author | catherine.devlin@gmail.com |
---|---|
date | Thu, 25 Aug 2011 16:27:42 -0400 |
parents | 2377461a35f3 |
children |
rev | line source |
---|---|
151
2377461a35f3
bug is in Combine() - removed it
catherine@Elli.myhome.westell.com
parents:
150
diff
changeset
|
1 from pyparsing import * |
2377461a35f3
bug is in Combine() - removed it
catherine@Elli.myhome.westell.com
parents:
150
diff
changeset
|
2 |
2377461a35f3
bug is in Combine() - removed it
catherine@Elli.myhome.westell.com
parents:
150
diff
changeset
|
3 teststr = 'please /* ignoreme: | oops */ findme: | kthx' |
2377461a35f3
bug is in Combine() - removed it
catherine@Elli.myhome.westell.com
parents:
150
diff
changeset
|
4 parser = Word(printables)('leadWord') + SkipTo('|')('statement') |
2377461a35f3
bug is in Combine() - removed it
catherine@Elli.myhome.westell.com
parents:
150
diff
changeset
|
5 print parser.parseString(teststr).statement |
2377461a35f3
bug is in Combine() - removed it
catherine@Elli.myhome.westell.com
parents:
150
diff
changeset
|
6 parser.ignore(cStyleComment) |
2377461a35f3
bug is in Combine() - removed it
catherine@Elli.myhome.westell.com
parents:
150
diff
changeset
|
7 print parser.parseString(teststr).statement |
2377461a35f3
bug is in Combine() - removed it
catherine@Elli.myhome.westell.com
parents:
150
diff
changeset
|
8 parser = Combine(parser) |
2377461a35f3
bug is in Combine() - removed it
catherine@Elli.myhome.westell.com
parents:
150
diff
changeset
|
9 print parser.parseString(teststr).statement |
2377461a35f3
bug is in Combine() - removed it
catherine@Elli.myhome.westell.com
parents:
150
diff
changeset
|
10 parser.ignore(cStyleComment) |
2377461a35f3
bug is in Combine() - removed it
catherine@Elli.myhome.westell.com
parents:
150
diff
changeset
|
11 print parser.parseString(teststr).statement |