Skip to content

Instantly share code, notes, and snippets.

View PaperclipBadger's full-sized avatar

Blaine Rogers PaperclipBadger

View GitHub Profile
"""
parser_combinators.py
--------------------
Functions that make it easy to create string parsers.
A parser is a function that takes a string ``remaining`` and returns a pair.
If the parser was unsuccessful (the string does not patch the pattern of
characters that that parser accepts), it returns ``(None, remaining)``.
Otherwise, it returns a pair whose first element is the parsing result