aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Json.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavierleroy@users.noreply.github.com>2016-03-21 10:18:51 +0100
committerXavier Leroy <xavierleroy@users.noreply.github.com>2016-03-21 10:18:51 +0100
commit20eef936dce1ef98b5b422c90cc9e072fb0d75ab (patch)
tree2690be164dc36fad63fc0f42e943d0fcb0735532 /lib/Json.ml
parentfdf4cac2439a7168bd005efbde4a1f76a00ada66 (diff)
parent01e32a075023ce7b037d42d048b1904ba3d9a82b (diff)
downloadcompcert-kvx-20eef936dce1ef98b5b422c90cc9e072fb0d75ab.tar.gz
compcert-kvx-20eef936dce1ef98b5b422c90cc9e072fb0d75ab.zip
Merge pull request #92 from AbsInt/cleanup
This PR activates more OCaml warnings and turns all warnings into errors. Also some unused functions, variables and types are removed.
Diffstat (limited to 'lib/Json.ml')
-rw-r--r--lib/Json.ml12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Json.ml b/lib/Json.ml
index 4aa91e95..22b50a9e 100644
--- a/lib/Json.ml
+++ b/lib/Json.ml
@@ -15,7 +15,8 @@ open Printf
(* Simple functions for JSON printing *)
(* Print a string as json string *)
-let p_jstring oc s = fprintf oc "\"%s\"" s
+let p_jstring oc s =
+ fprintf oc "\"%s\"" s
(* Print a list as json array *)
let p_jarray elem oc l =
@@ -29,13 +30,20 @@ let p_jarray elem oc l =
(* Print a bool as json bool *)
let p_jbool oc = fprintf oc "%B"
-(* Print a int as json int *)
+(* Print an int as json int *)
let p_jint oc = fprintf oc "%d"
+(* Print an int32 as json int *)
+let p_jint32 oc = fprintf oc "%ld"
+
(* Print a member *)
let p_jmember oc name p_mem mem =
fprintf oc "\n%a:%a" p_jstring name p_mem mem
+(* Print singleton object *)
+let p_jsingle_object oc name p_mem mem =
+ fprintf oc "{%a:%a}" p_jstring name p_mem mem
+
(* Print optional value *)
let p_jopt p_elem oc = function
| None -> output_string oc "null"