Skip to content

Commit

Permalink
fix take_while
Browse files Browse the repository at this point in the history
  • Loading branch information
bikallem committed Jun 29, 2021
1 parent 3263425 commit 730b396
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## v3.0.0 2021-08-06 UK
## v3.0.1 2021-06-29

- Fix `take_while`

## v3.0.0 2021-06-23 UK

- Overhaul parser implementation - use functor based implementation. Introduce, `Make_buffered_input`, `Make_unbuffered_input` and `Make` functors.
- Remove `reparse-unix` package
Expand Down
6 changes: 4 additions & 2 deletions lib/reparse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -602,11 +602,13 @@ struct
items := a :: !items ;
unit )
p
*> return (List.rev !items)
>>= fun () -> return (List.rev !items)

let take_between : ?sep_by:_ t -> start:_ t -> end_:_ t -> 'a t -> 'a list t =
fun ?sep_by ~start ~end_ p ->
start *> take_while ?sep_by ~while_:(is_not end_) p <* end_
start
>>= fun _ ->
take_while ?sep_by ~while_:(is_not end_) p >>= fun l -> end_ >>| fun _ -> l

(*+++++ RFC 5234 parsers *)

Expand Down

0 comments on commit 730b396

Please sign in to comment.