mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 19:25:28 -05:00
minor changes
This commit is contained in:
parent
938c7cb90a
commit
9c72797515
2 changed files with 4 additions and 4 deletions
|
|
@ -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 = {
|
let exact s = {
|
||||||
run=fun st ~ok ~err ->
|
run=fun st ~ok ~err ->
|
||||||
(* parse a string of length [String.length s] and compare with [s] *)
|
(* 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 ->
|
~ok:(fun st s2 ->
|
||||||
if string_equal s s2 then ok st s
|
if string_equal s s2 then ok st s
|
||||||
else (
|
else (
|
||||||
|
|
|
||||||
|
|
@ -190,8 +190,8 @@ val any_char : char t
|
||||||
It still fails if the end of input was reached.
|
It still fails if the end of input was reached.
|
||||||
@since NEXT_RELEASE *)
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
val any_chars : int -> string t
|
val any_char_n : int -> string t
|
||||||
(** [any_chars len] parses exactly [len] characters from the input.
|
(** [any_char_n len] parses exactly [len] characters from the input.
|
||||||
Fails if the input doesn't contain at least [len] chars.
|
Fails if the input doesn't contain at least [len] chars.
|
||||||
@since NEXT_RELEASE *)
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue