2012-04-01 | Paul Boddie | raw annotate files changeset graph | Changed the section nesting syntax to use the general convention described on the HelpOnParsers page where {{{...}}} sections can be nested within sections employing more { and } characters in their start and end markers respectively. Revised the tests for the new syntax. Added a help page for the extension. |
1 #!/usr/bin/env python 2 3 from ImprovedTableParser import patterns 4 5 text = """ 6 {{{{{ 7 Hello 8 {{{{ 9 Hello again 10 And also {{{ this }}} 11 {{{ 12 And once again 13 }}} 14 And again 15 }}}} 16 again 17 }}}} 18 """ 19 20 matches = patterns["markers"].split(text) 21 expected = 17 22 23 print text 24 print 25 print matches 26 print 27 print len(matches) == expected, ": length is", len(matches), "==", expected 28 29 # vim: tabstop=4 expandtab shiftwidth=4