Yeah, I went this route as well (though splitting the blob into many strings I Enum.map/2 over), but it annoys me, that I have to do pretty much the same thing the parser does anyway (counting parens that are not in a string).
Id be happy with something that would roughly do this: {:ok, #{}, "{}"} = imaginary_parser("{}{}"), such that I can consume the remainder until it becomes "" and therefore I know I have parsed the full input stream.






















