https://gitlab.com/tezos/tezos
Revision c2d41b56dcfb0b357390f68215de0e4c01a47ec0 authored by lykimq on 10 November 2022, 02:19:50 UTC, committed by Marge Bot on 10 November 2022, 09:42:43 UTC
1 parent 59a66d5
Raw File
Tip revision: c2d41b56dcfb0b357390f68215de0e4c01a47ec0 authored by lykimq on 10 November 2022, 02:19:50 UTC
Michelson/Python: add contract bad_annot_contract.tz
Tip revision: c2d41b5
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 "@ ]@]"
back to top