Repository navigation
0.4.0
CHANGES:
- Breaking: streaming now uses a bounded sliding buffer.
parse_sourceandparse_source_until_endaccept~backtrack_window(default65536) and fail withBacktrack_window_exceeded of backtrack_window_error</code> when a parser needs to keep more input than that for backtracking. This includes a singletake_whileortake_while_spantoken longer than the window. Exhaustive matches on the error type must handle the new case. Raise~backtrack_window` if a parser needs more. - Add
commit.commit ()seals the innermost choice or repetition frame, improving error locality and allowing streaming sources to drop older buffered input earlier. It does not release outer frames: acommitinside theor_ofmany (fun () -> or_ a b ())leaves themanyframe in place. - Breaking: streaming spans may be owned copies.
take_while_spanandsep_by_take_spankeep zero-copy behavior forparse, butparse_sourcemay materialize owned spans so bounded streaming can reclaim old prefixes. - Improve runtime performance and reduce allocation. Parseff now uses a lower-overhead runtime internally, making generic parsers and backtracking-heavy workloads faster while keeping the API largely unchanged.
- Add
peek_char. Provides cheap single-character lookahead without backtracking. - Fix streaming results that differed from
parse.Utf8.take_whileand related scans now report a truncated UTF-8 sequence at the end of input.match_regexnow finds matches that need more than the buffered input, andRe.boland word boundaries see the byte before the current position. - Fix
locationline numbers after backtracking. Lines were counted twice when a parser asked forlocationafter backtracking to an earlier position. match_regexreads ahead in streaming mode. It reads until about half the backtrack window is buffered ahead before it matches, so on an interactive source it waits for that input or the end of the source. A match cannot extend past the window.