minor changes

This commit is contained in:
Simon Cruanes 2021-09-25 20:51:18 -04:00
parent 938c7cb90a
commit 9c72797515
No known key found for this signature in database
GPG key ID: 4AC01D0849AA62B6
2 changed files with 4 additions and 4 deletions

View file

@ -657,12 +657,12 @@ let take len : slice t = {
)
}
let any_chars len : _ t = take len >|= Slice.to_string
let any_char_n len : _ t = take len >|= Slice.to_string
let exact s = {
run=fun st ~ok ~err ->
(* parse a string of length [String.length s] and compare with [s] *)
(any_chars (String.length s)).run st
(any_char_n (String.length s)).run st
~ok:(fun st s2 ->
if string_equal s s2 then ok st s
else (

View file

@ -190,8 +190,8 @@ val any_char : char t
It still fails if the end of input was reached.
@since NEXT_RELEASE *)
val any_chars : int -> string t
(** [any_chars len] parses exactly [len] characters from the input.
val any_char_n : int -> string t
(** [any_char_n len] parses exactly [len] characters from the input.
Fails if the input doesn't contain at least [len] chars.
@since NEXT_RELEASE *)