summaryrefslogtreecommitdiff
path: root/src/json.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/json.sml')
-rw-r--r--src/json.sml4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/json.sml b/src/json.sml
index cc9ea6ae..656d28ff 100644
--- a/src/json.sml
+++ b/src/json.sml
@@ -271,7 +271,9 @@ fun print (ast: json): string =
s ^
"\""
| Bool b => if b then "true" else "false"
- | Int i => Int.toString i
+ | Int i => if i >= 0
+ then (Int.toString i)
+ else "-" ^ (Int.toString (Int.abs i)) (* default printing uses ~ instead of - *)
| Obj l => "{"
^ List.foldl (fn ((k, v), acc) => acc ^ (if acc = "" then "" else ", ") ^ "\"" ^ k ^ "\": " ^ print v ) "" l
^ "}"