Skip to content

Instantly share code, notes, and snippets.

@crowsonkb
Last active June 11, 2019 00:40
Show Gist options
  • Save crowsonkb/cd47454d0b8c854ece40eeaa97fdbeeb to your computer and use it in GitHub Desktop.
Save crowsonkb/cd47454d0b8c854ece40eeaa97fdbeeb to your computer and use it in GitHub Desktop.
Pretty printer for pyparsing.ParseResults
from prettyprinter import register_pretty, pretty_call
import pyparsing as pp
@register_pretty(pp.ParseResults)
def pretty_parse_results(value, ctx):
return pretty_call(ctx, pp.ParseResults, value.asList(), value.asDict())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment