Revision e12f6f51d2607e566e1cedc47b6d545d8ee5b6f8 authored by Sylvain Ribstein on 30 November 2022, 15:01:05 UTC, committed by Marge Bot on 05 December 2022, 12:45:11 UTC
1 parent a1306b4
JSON_AST.ml
type t =
[ `Null
| `Bool of bool
| `Float of float
| `String of string
| `O of (string * t) list
| `A of t list ]
let f = Format.fprintf
let rec pp fmt = function
| `Null -> f fmt "null"
| `Bool x -> f fmt "%b" x
| `Float x -> f fmt "%g" x
| `String x -> f fmt "%S" x
| `O l ->
f fmt "@[<hv 2>{@ " ;
List.iteri
(fun i (k, v) ->
if i <> 0 then f fmt ",@ " ;
f fmt "%S: %a" k pp v)
l ;
f fmt "@ }@]"
| `A l ->
f fmt "@[<hv 2>[@ " ;
List.iteri
(fun i x ->
if i <> 0 then f fmt ",@ " ;
f fmt "%a" pp x)
l ;
f fmt "@ ]@]"
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...