Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions gist/json.ml
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,7 @@ let rec format std (x : Yojson.t) =
| `List l -> List (("[", ",", "]", array), List.map (format std) l)
| `Assoc [] -> Atom ("{}", atom)
| `Assoc l -> List (("{", ",", "}", record), List.map (format_field std) l)
| `Tuple l ->
if std then
format std (`List l)
else
if l = [] then
Atom ("()", atom)
else
List (("(", ",", ")", tuple), List.map (format std) l)

| `Variant (s, None) ->
if std then
format std (`String s)
else
Atom ("<" ^ json_string_of_string s ^ ">", atom)

| `Variant (s, Some x) ->
if std then
format std (`List [ `String s; x ])
else
let op = "<" ^ json_string_of_string s ^ ":" in
List ((op, "", ">", variant), [format std x])

and format_field std (name, x) =
(*let s = sprintf "%s:" (json_string_of_string name) in*)
let s = json_string_of_ident name in
Expand Down
1 change: 1 addition & 0 deletions github-unix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ depends: [
"cohttp-lwt-unix" {>= "4.0.0"}
"stringext"
"cmdliner" {>= "1.1.0"}
"yojson" {>= "3.0.0"}
"base-unix"
"lwt"
]
Expand Down