summaryrefslogtreecommitdiff
path: root/ignoreBug.py
diff options
context:
space:
mode:
authorZearin <zearin@gonk.net>2011-10-05 17:05:31 -0400
committerZearin <zearin@gonk.net>2011-10-05 17:05:31 -0400
commitaa19e3b9c9f03f7320c2d5470fa977ed0bbdeeab (patch)
tree97d86fe3a03114be08aac12a7097aa80ac03bc2a /ignoreBug.py
downloadcmd2-aa19e3b9c9f03f7320c2d5470fa977ed0bbdeeab.tar.gz
Initial import.
Copy of the Python module cmd2 by Catherine Devlin. Note that this is NOT the official copy (it’s at http://www.assembla.com/spaces/python-cmd2/wiki ). I’d rather just work using git + GitHub instead of hg + Assembla. ☺ OTOH, I fully intend to submit changes back to the official repo on Assembla—so don’t be shy, fork away. I’m happy for any help!
Diffstat (limited to 'ignoreBug.py')
-rw-r--r--ignoreBug.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ignoreBug.py b/ignoreBug.py
new file mode 100644
index 0000000..3781933
--- /dev/null
+++ b/ignoreBug.py
@@ -0,0 +1,11 @@
+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