def optional(parser, default=None):
    return choice(parser, lambda: default)
Tries to apply the provided parser, returning default if the parser fails.
dataset/ETHPy150Open brehaut/picoparse/picoparse/__init__.py/optional