Python pyparsing.originalTextFor() Examples

The following are 1 code examples of pyparsing.originalTextFor(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pyparsing , or try the search function .
Example #1
Source File: nested_markup.py    From pyparsing with MIT License 5 votes vote down vote up
def convert_markup_to_html(opening, closing):
    def conversionParseAction(s, l, t):
        return opening + wiki_markup.transformString(t[1][1:-1]) + closing

    return conversionParseAction


# use a nestedExpr with originalTextFor to parse nested braces, but return the
# parsed text as a single string containing the outermost nested braces instead
# of a nested list of parsed tokens