Stdlib: do not use deprecated stringext

This commit is contained in:
Vincent Bernardoff 2018-05-10 10:26:42 +02:00 committed by Grégoire Henry
parent f8247ff6c9
commit 1cd82f5d82
2 changed files with 3 additions and 3 deletions

View File

@ -4,9 +4,8 @@
((name tezos_stdlib)
(public_name tezos-stdlib)
(libraries (ocplib-endian.bigstring
cstruct
stringext
hex
re
zarith
lwt
lwt.log))

View File

@ -18,6 +18,7 @@ module Infix = struct
end
let nbsp = Re.(compile (str "\xC2\xA0"))
let display_paragraph ppf description =
Format.fprintf ppf "@[%a@]"
(Format.pp_print_list ~pp_sep:Format.pp_print_newline
@ -26,7 +27,7 @@ let display_paragraph ppf description =
(fun ppf w ->
(* replace   by real spaces... *)
Format.fprintf ppf "%s@ "
(Stringext.replace_all ~pattern:"\xC2\xA0" ~with_:" " w))
(Re.replace ~all:true nbsp ~f:(fun _ -> " ") w))
ppf
(TzString.split ' ' line)))
(TzString.split ~dup:false '\n' description)