From ffee388a149836b1f8d128bc953c1b0363cee82b Mon Sep 17 00:00:00 2001 From: Paul McGuire Date: Sat, 6 Jul 2019 00:34:19 -0500 Subject: Add support for multiple '...' skips in a single expression; `_skippped` results name will always return a list of skipped items --- examples/nested_markup.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'examples/nested_markup.py') diff --git a/examples/nested_markup.py b/examples/nested_markup.py index 40267e6..6d83636 100644 --- a/examples/nested_markup.py +++ b/examples/nested_markup.py @@ -27,11 +27,12 @@ bolded = ('bold' + markup_body).setParseAction(convert_markup_to_html("", "{link_text}'.format_map(t) -urlRef = ('link' - + '{' + pp.SkipTo('->')('link_text') + '->' + pp.SkipTo('}')('url') + '}' - ).setParseAction(convert_link_to_html) + +urlRef = (pp.Keyword('link') + '{' + ... + '->' + ... + '}').setParseAction(convert_link_to_html) # now inject all the markup bits as possible markup expressions wiki_markup <<= urlRef | italicized | bolded -- cgit v1.2.1