streamly
streamly copied to clipboard
Maintain negative count in parsers for backtracking
Now we represent backtracking by negative offsets in the Partial/Continue constructors. In some parsers (e.g. deintercalate) we maintain a positive count and then for backtracking we negate it when returning the count, instead we can directly maintain a negative count, that makes the code simpler, same as it was before the change from +ve to -ve offsets in the constructors.