For testing purposes, I think I would have split the parser into a separate utility function that raised a ParseError when it hit something it couldn't work with and if it successfully made it through, returned a list of NamedTuples or something.