Skip to content

Commit 2936577

Browse files
authored
Merge pull request #354 from NathanReb/fmt-0-9
Replace uses of deprecated fmt functions
2 parents fa09ec0 + 2f1c5d7 commit 2936577

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

bin/pp.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let run (`Setup ()) (`File file) (`Section section) =
4646
| Block b ->
4747
if not (Mdx.Block.skip b) then (
4848
Log.debug (fun l -> l "pp: %a" Mdx.Block.dump b);
49-
let pp_lines = Fmt.(list ~sep:(unit "\n") string) in
49+
let pp_lines = Fmt.(list ~sep:(any "\n") string) in
5050
let contents = Mdx.Block.executable_contents ~syntax:Normal b in
5151
match b.value with
5252
| Toplevel _ -> Fmt.pr "%a\n" pp_lines contents

dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
(ocaml
2323
(>= 4.08.0))
2424
ocamlfind
25-
(fmt (>= 0.8.5))
25+
(fmt (>= 0.8.7))
2626
(cppo :build)
2727
(csexp
2828
(>= 1.3.2))

lib/block.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ let pp_lines syntax t =
128128
fun ppf -> Fmt.fmt "%*s%s" ppf (t.loc.loc_start.pos_cnum + 2) ""
129129
| _ -> Fmt.string
130130
in
131-
Fmt.(list ~sep:(unit "\n") pp)
131+
Fmt.(list ~sep:(any "\n") pp)
132132

133133
let lstrip string =
134134
let hpad = Misc.hpad_of_lines [ string ] in
@@ -160,11 +160,11 @@ let pp_footer ?syntax ppf t =
160160

161161
let pp_legacy_labels ppf = function
162162
| [] -> ()
163-
| l -> Fmt.pf ppf " %a" Fmt.(list ~sep:(unit ",") Label.pp) l
163+
| l -> Fmt.pf ppf " %a" Fmt.(list ~sep:(any ",") Label.pp) l
164164

165165
let pp_labels ppf = function
166166
| [] -> ()
167-
| l -> Fmt.pf ppf "<!-- $MDX %a -->\n" Fmt.(list ~sep:(unit ",") Label.pp) l
167+
| l -> Fmt.pf ppf "<!-- $MDX %a -->\n" Fmt.(list ~sep:(any ",") Label.pp) l
168168

169169
let pp_header ?syntax ppf t =
170170
match syntax with

lib/document.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let pp_line ?syntax ppf (l : line) =
3030
| _ -> Fmt.pf ppf "%s\n" s)
3131

3232
let pp ?syntax ppf t =
33-
Fmt.pf ppf "%a\n" Fmt.(list ~sep:(unit "\n") (pp_line ?syntax)) t
33+
Fmt.pf ppf "%a\n" Fmt.(list ~sep:(any "\n") (pp_line ?syntax)) t
3434

3535
let to_string = Fmt.to_to_string pp
3636

lib/misc.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ let pp_pad ppf = function
2929
| 0 -> ()
3030
| i -> Fmt.string ppf (String.v ~len:i (fun _ -> ' '))
3131

32-
let pp_lines pp = Fmt.(list ~sep:(unit "\n") pp)
32+
let pp_lines pp = Fmt.(list ~sep:(any "\n") pp)
3333

3434
let dump_string ppf s = Fmt.pf ppf "%S" s
3535

@@ -55,4 +55,4 @@ let pp_position ppf lexbuf =
5555

5656
(* TODO: better error reporting *)
5757
let err lexbuf fmt =
58-
Fmt.kstrf (fun str -> Fmt.failwith "%a: %s" pp_position lexbuf str) fmt
58+
Fmt.kstr (fun str -> Fmt.failwith "%a: %s" pp_position lexbuf str) fmt

lib/test/mdx_test.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ let eval_test ?block ?root c cmd =
127127

128128
let err_eval ~cmd lines =
129129
Fmt.epr "Got an error while evaluating:\n---\n%a\n---\n%a\n%!"
130-
Fmt.(list ~sep:(unit "\n") string)
130+
Fmt.(list ~sep:(any "\n") string)
131131
cmd
132-
Fmt.(list ~sep:(unit "\n") string)
132+
Fmt.(list ~sep:(any "\n") string)
133133
lines;
134134
exit 1
135135

mdx.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ depends: [
2121
"dune" {>= "2.7"}
2222
"ocaml" {>= "4.08.0"}
2323
"ocamlfind"
24-
"fmt" {>= "0.8.5"}
24+
"fmt" {>= "0.8.7"}
2525
"cppo" {build}
2626
"csexp" {>= "1.3.2"}
2727
"astring"

0 commit comments

Comments
 (0)